PDA

View Full Version : 20 bit data whith SHIFTOUT



Samoele
- 20th January 2006, 09:48
hello friends,

Can you tell me how to send 20 bit data in one string with the SHIFTOUT command.

Thanks & Regards

Samo

keithdoxey
- 20th January 2006, 10:08
Depends how your data is stored but there are several options

shiftout DataPin, ClockPin,1,[myWord/16,myHalfbyte/4]

shiftout DataPin, ClockPin,1,[mysystem/8,myDevice/4,myFunction/8]

shiftout DataPin, ClockPin,1,[bit1/1,bit2/1,.....bit20/1]

This is an example of how I shift a load of data to drive 64 LEDs

shiftout DataPin, ClockPin,1,[$00,TwoDigits,FourDigits/16,TempZoneID,TempZoneSource,$00,$00]

Hope that helps

Samoele
- 20th January 2006, 13:05
Thank You Keith,

I have now another problem;
Clock and data is not synchronized. Clock pulse is 50% slowly. Must be clock seperated with data?
Can you help me and write routine for this shift?
I use PIC10F202 whith internal clock.

please see attach file

thanks, regards

Samo