|
Shifting the line low and then high is important because the process is initiated when the shift to low is detected. I was using line 8 on the original posting and the timing is an issue unless you monitor the lines to determine when the process is complete. By inserting a 1 second delay you can ensure that the operation is complete before initiating another task. You must also take note of the shiftin/shiftout commands because they default to 16 bits instead of 8 as with the BS2. Below is an example of some code that works very well, but timing delays can be changed to suit your system requirements. The code below uses port 0 shifting low and then high to get ready for the next shift command and does an APC read.
APCREAD: 'POWER UP ISD HIGH 0:PAUSE 2 LOW 0:PAUSE 2 SHIFTOUT MOSI,SCLK,LSBFIRST,[17\8,0\8]:HIGH 0:PAUSE 2 'RD_APC LOW 0:PAUSE 2 SHIFTOUT MOSI,SCLK,LSBFIRST,[68\8,0\8,0\8,0\8]:HIGH 0:PAUSE 2 'DISPLAY MISO DATA FOR APC LOW 0:PAUSE 2 SHIFTIN MISO,SCLK,LSBFIRST,[MISODAT1,MISODAT2,MISODAT3,MISODAT4]:HIGH 0:PAUSE 2
Thanks for the input.
_________________ Harley
|