Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Q for INPUT Command

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
al

Bascom Member



Joined: 29 Jun 2004
Posts: 7

PostPosted: Tue Jun 29, 2004 1:41 pm    Post subject: Q for INPUT Command Reply with quote

Hello,
I need a trick to input via terminal(rs232) a 48bit long hex number
(FFFFFFFFFFFF hex) under bascom Avr.
the INPUT command only suport a LONG var. (FFFFFFFF hex)
i need to input the 48bit number complete, and not in 3 times word.
any idea?
bye
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Wed Jun 30, 2004 10:22 pm    Post subject: Reply with quote

While you could get the number, where would you store it?
As you can not use a LONG, what good is it , to have the 48 bits?
the best option would be to change the lib code in mcs.lib so 48 bits are fetches instead of 32.

_________________
Mark
Back to top
View user's profile Visit poster's website
al

Bascom Member



Joined: 29 Jun 2004
Posts: 7

PostPosted: Thu Jul 01, 2004 7:11 am    Post subject: Reply with quote

i would to store the 48bit number in sram.
i need the 48bit number to adress a hd drive in lba mode.
wenn i make the code: (e.g. the complete number is 112233445566 hex)
input long
input word

then i must press return after the first 32bit (e.g.11223344hex)
the i must input the other bytes (e.g.5566hex). and press return.

i need a code to press only 1 time return.
(e.g. dim x as superlong48bit
input x )
after input the number i will split the 48bit number in 6x 1byte.
e.g.
a=11hex
b=22hex
c=33hex
d=44hex
e=55hex
f=66hex

please help.
Back to top
View user's profile
satz

Bascom Member



Joined: 26 Apr 2004
Posts: 22

malaysia.gif
PostPosted: Sat Jul 03, 2004 3:20 am    Post subject: Reply with quote

Use the inputbin command, e.g.

Dim ar(6) as byte

Inputbin ar(1);6 'will load 6 bytes (48 bits) into the array

Please note that the inputbin does NOT wait for the <return>,
but executes when the specified number of bytes is received
Back to top
View user's profile
al

Bascom Member



Joined: 29 Jun 2004
Posts: 7

PostPosted: Sat Jul 03, 2004 7:07 pm    Post subject: Reply with quote

thanks!
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum