HELP 74LV8153N Shitft register ,can anyone give me code ???
Igor_Rast
Posts: 357
Hi there , ive been fooling around some time to get this 74lv8153 shift register working over 1 wire so I can save some pin's.
thout I had a working program but i lost it and it didn't work well
can anyone please help me with some sample code on how to get the
data in the shift register,
2start bit+ 3 Adress bits + 4 data bits + 1stop bit
sending this string twice should get the data in but i can't get it working right
please some help ,
if the codet can read let say from a data file how to set the outputstates would be great *** thats what I finally need, or just a good control of the shift register
hope to hear something
igor
thout I had a working program but i lost it and it didn't work well
can anyone please help me with some sample code on how to get the
data in the shift register,
2start bit+ 3 Adress bits + 4 data bits + 1stop bit
sending this string twice should get the data in but i can't get it working right
please some help ,
if the codet can read let say from a data file how to set the outputstates would be great *** thats what I finally need, or just a good control of the shift register
hope to hear something
igor
Comments
As it is standard RS232 serial to parallel.
You can use any of Serial RS232 driver in OBX
Here is apossible send methode (untested):
Andy
Serial data sends the low bit first (immediately after the start bit). The protocol of the 74xx8153 requires 2 start bits, 7 data bits and 1 stop bits, two characters. However, the 2 start bits is a misnomer because they require the second start bit to be a "1" not a "0". Therefore, what they really mean is 1 start bit "0" followed by the lowest bit (must always be "1") followed by a0, a1, a2 as the address bits (determined by the hardware pins), followed by d0, d1, d2, d3 of the low nibble of the latch contents you require to set, followed by a stop bit ("1"). The next character is start "0" followed by a "1" followed by a0, a1, a2 again, and then data bits d4, d5, d6, d7 of the high nibble of the latch contents you require to set and stop bit..
So, your 2 characters (bytes) to be sent are...
%d3, d2, d1, d0, a2, a1, a0, "1"
%d7, d6, d5, d4, a2, a1, a0, "1"
I hope this makes sense.
The first byte is made up of %1aaallll where aaa=the address pins, and llll (LLLL) = low nibble. The second byte is %1aaauuu where uuuu = the upper nibble. Configure to send at 24,000 baud or less (19,200 would be a good choice).
i did somthing like this
but it ai't working
please help me as im sure that im overlookig somthing
You don't need to include the simple_serial object. But this is not the problem.
There was a little error in the send routine: the bits are shifted before first bit output.
Try this one:
Andy