SPI Modes?
Posted: Wed Oct 24, 2007 8:46 pm
Hi,
I have build a test circuit on breadboard using a 18F452 and MAX3100 (SPI UART).
I have initialised the SPI and MAX3100 according to the specification. On the sending side, everything works fine, when I send ASCII characters via the SPI bus to the MAX3100 then they're all send out via the RS232 port (checked with Hyperterminal). On the receiving side things does not want to work so well.
When the MAX3100 receives the RS232 data, it generates an Interrupt (RB1/INT1). The interrupt works, and executes when I send a character from Hyperterminal to the MAX3100. The macro that is executed when RB1/INT1 triggers, should read the data from the SPI and then echo it back to the MAX3100 again, but I only receive "00001011" back no matter what I send.
I have written this test routine in MPLAB using C18 and it works, so I know that my HW is correct. I just can not get it to work writing the code in Flowcode.
I have compared the settings in both programs and the only part that I am not sure about at this stage is the bus mode. In MPLAB with C18, it works when the bus mode is in MODE 00.
How do I determine what the bus mode is in Flowcode?
And, I will really appreciate some pointers, if anyone have managed to get a MAX3100 working in both sending and receiving.
Thanks for your comments/help!
Regards
Jan
I have build a test circuit on breadboard using a 18F452 and MAX3100 (SPI UART).
I have initialised the SPI and MAX3100 according to the specification. On the sending side, everything works fine, when I send ASCII characters via the SPI bus to the MAX3100 then they're all send out via the RS232 port (checked with Hyperterminal). On the receiving side things does not want to work so well.
When the MAX3100 receives the RS232 data, it generates an Interrupt (RB1/INT1). The interrupt works, and executes when I send a character from Hyperterminal to the MAX3100. The macro that is executed when RB1/INT1 triggers, should read the data from the SPI and then echo it back to the MAX3100 again, but I only receive "00001011" back no matter what I send.
I have written this test routine in MPLAB using C18 and it works, so I know that my HW is correct. I just can not get it to work writing the code in Flowcode.
I have compared the settings in both programs and the only part that I am not sure about at this stage is the bus mode. In MPLAB with C18, it works when the bus mode is in MODE 00.
How do I determine what the bus mode is in Flowcode?
And, I will really appreciate some pointers, if anyone have managed to get a MAX3100 working in both sending and receiving.
Thanks for your comments/help!
Regards
Jan