Hi Champion,
That IC uses a synchronous serial interface so SERIN will not work. I think you need to have a look at the SHIFTIN command instead. I'm not sure if it can shift in all 22bits in one shot but perhaps it can. It can definetly read the lower 16bits in one go - perhaps that's enough for you.
Code:
Counter VAR WORD
LOW CS 'Select chip
HIGH PLSR 'Load counter to shift register
'Shift in 16bits of data. you may need to experiment with the mode number.
Shiftin CNTdata, CLKsr, 3, [Counter\16]
Low PLSR
High CS 'Deselct chip.
'Display or whatever.
The datasheets indicates that the PLSR needs to be held high while reading the first bit so I guess it CAN be held high while reading the rest too since the shift register is loaded on the rising of PLSR going high. You'll have to experiment there.
Try to get it to read the lower 16bits first, then we can figure out a way to read all 22. I think that the tricky part will be what to to with the 22bits when you have them in the PIC.
/Henrik Olsson.
Bookmarks