Truncated match.
PICList
Thread
'9 bit data to 16F84'
1999\02\19@130246
by
glam
Hi, guys,
Newbie in PIC need some help. I want to use 16f84 to clock
in 9 bit of data, LSB first, and then send it to LCD
display. Seems the work register only works with 8 bit data.
How could I work this out?
1999\02\19@133616
by
Vincent Deno
> Hi, guys, Newbie in PIC need some help. I want to use 16f84 to clock
> in 9 bit of data, LSB first, and then send it to LCD display. Seems
> the work register only works with 8 bit data. How could I work this
> out?
>
I'm assuming you are having trouble sending out the data to the LCD
display serially... simply put the 9th bit in the carry register and clock
the bit out before shifting the other 8 bits.
-Vincent Deno
1999\02\19@134913
by
Gerhard Fiedler
At 13:05 02/19/99 -0500, glam wrote:
>Newbie in PIC need some help. I want to use 16f84 to clock
>in 9 bit of data, LSB first, and then send it to LCD
>display. Seems the work register only works with 8 bit data.
>How could I work this out?
you could probably use either the carry flag, or, if you use two bytes for
intermediate storage anyway, just save it after the first 8 bits. depends
on what exactly you do with the 9 bits.
ge
1999\02\19@144738
by
glam
Vicent,
Thanks for your advise. I am having trouble where to store
the 9 bit data. I want to use the first bit, LSB, to drive a
LED on/off and the send the rest 8 bits to LCD. But the work
register only has 8 bit storage.
Gary
>
>I'm assuming you are having trouble sending out the data to
the LCD
>display serially... simply put the 9th bit in the carry
register and clock
>the bit out before shifting the other 8 bits.
>
>-Vincent Deno
>
1999\02\19@144938
by
Wagner Lipnharski
At 13:05 02/19/99 -0500, glam wrote:
>Newbie in PIC need some help. I want to use 16f84 to clock
>in 9 bit of data, LSB first, and then send it to LCD
>display. Seems the work register only works with 8 bit data.
>How could I work this out?
First, LCD will only works with 8 bits, so, from the 9 bits it
will be receiving, which one will be put away? So you can
avoid it right at the reception time. First, last, which one?
Wagner.
1999\02\19@154151
by
glam
I want to use the first bit, LSB, to drive a LED and use the
rest 8 bits for LCD display. I don't know how to store those
9 bits and then separate the LSB, because the W register
only has 8 bits, but the 9 bits of data come in serially.
Gary
>>I want to use 16f84 to clock in 9 bits of data, LSB first,
and then send it to LCD
>>display. Seems the work register only works with 8 bit
data.
>>How could I work this out?
>
>First, LCD will only works with 8 bits, so, from the 9 bits
it
>will be receiving, which one will be put away? So you can
>avoid it right at the reception time. First, last, which
one?
>
>Wagner.
1999\02\19@200640
by
Mike Keitz
|
On Fri, 19 Feb 1999 15:46:17 -0500 glam <spam_OUTglam4seasTakeThisOuT
MEDIAONE.NET> writes:
>I want to use the first bit, LSB, to drive a LED and use the
>rest 8 bits for LCD display. I don't know how to store those
>9 bits and then separate the LSB, because the W register
>only has 8 bits, but the 9 bits of data come in serially.
>Gary
One approach is to write the receive routine so it receives the bit that
controls the LED first and store it in one place, then receives the 8
bits for the LCD and stores them in another place. That method looks
good for a beginner, but is not as clean as receiving all 9 bits at once.
It is easy to use data larger than 8 bits on a PIC by storing it in 2 or
more "file register" RAM locations. In the case of receiving serial
data, do something like:
clrc
btfsc PORT,bit ;Is the serial input low?
setc ;No it's high.
; Now the bit just received is in C. Rotate it into the shift register
rrf datahi,f
rrf datalo,f
After doing this 9 times, the first bit received is in the high bit of
datahi, and the last 8 bits received (LSB first) are in datalo.
The W register is not too useful for serial reception because it can't be
rotated. Use RAM file registers (also 8 bits of course) instead.
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]
1999\02\19@205535
by
glam
Great! Thank you very much for your advise.
Gary.
>
>It is easy to use data larger than 8 bits on a PIC by
storing it in 2 or
>more "file register" RAM locations. In the case of
receiving serial
>data, do something like:
>
> clrc
> btfsc PORT,bit ;Is the serial input low?
> setc ;No it's high.
>; Now the bit just received is in C. Rotate it into the
shift register
> rrf datahi,f
> rrf datalo,f
>
>After doing this 9 times, the first bit received is in the
high bit of
>datahi, and the last 8 bits received (LSB first) are in
datalo.
>
>The W register is not too useful for serial reception
because it can't be
>rotated. Use RAM file registers (also 8 bits of course)
instead.
>
>
>
>
>___________________________________________________________
________
>You don't need to buy Internet access to use free Internet
e-mail.
>Get completely free e-mail from Juno at
http://www.juno.com/getjuno.html
>or call Juno at (800) 654-JUNO [654-5866]
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- Today
- New search...