Shiftout (SPI) and I2C issues
Thanks in advance for any help.
I am simply trying to get any serial communication going (not counting the standard asynchronous method) . I am using SX/B for the compiler and have tried generating basic SPI and I2C output. The weird thing is that I have attached the outputs to an oscilloscope and the chips only output occasional voltage spikes...no data. Please review the very basic software routines and let me know if I am missing anything.
R>
I am simply trying to get any serial communication going (not counting the standard asynchronous method) . I am using SX/B for the compiler and have tried generating basic SPI and I2C output. The weird thing is that I have attached the outputs to an oscilloscope and the chips only output occasional voltage spikes...no data. Please review the very basic software routines and let me know if I am missing anything.
R>

Comments
Start: TRIS_LEDs = %00000000 Main: DO FOR i = 0 to 255 SHIFTOUT Dpin, Cpin, LSBFIRST, i LEDs = i PAUSE 1000 NEXT LOOPBut that shouldn't matter too much in this case. I would expect to see data on your 'scope....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX FREQ 4_000_000 ID "SHIFTOUT" ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- Dpin PIN RA.0 OUTPUT ' shift data Cpin PIN RA.1 OUTPUT ' shift clock [b]Lpin PIN RA.2 OUTPUT ' latch it[/b] LEDs VAR RB TRIS_LEDs VAR TRIS_B ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- tmpB1 VAR Byte i VAR Byte ' ========================================================================= PROGRAM Start ' ========================================================================= Start: TRIS_LEDs = %00000000 DO FOR i = 0 to 255 SHIFTOUT Dpin, Cpin, LSBFIRST, i LEDs = i PAUSE 1000 [b]Pulsout Lpin, 1[/b] NEXT LOOP