Hi everyone. Currently I’m using RCM5700 to send and receive data via SPI, however when I try to transmit data (and read it in oscilloscope), it is always logic 1, regardless of what I am sending.
#class auto #define SPI_SER_B #define SPI_CLK_DIVISOR 100 #use “spi.lib”
You will need to set up the port pins correctly, direction and special functions etc. This is best done by modifying the brdInit() function in RCM57xx.LIB. You also need to make sure that one of the first things you do in main() is to call brdInit() to ensure all the i/o pins are in a consistent state.
Yes, it works already when i try to see the clock and the data I sent through SPI in oscilloscope. However, when I try to receive data through SPI, by giving a constant 3.3V to the RXB pin (I am using PORT B) and use printf to display the value, an error occurs. Previously, when I never give any input, the dynamic c will keep printing 0, and then when I put 3.3V to RXB, the dynamic c stop printing.