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
SPI Modes?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
By bus mode 0 I am assuming you mean Fosc/4 which is set in the SSPCON1 register. This is controlled via the SPI component property page.
If this does not help then would it be possible to send me the C functions for your C18 program and the FCF and C files from your flowcode program.
By bus mode 0 I am assuming you mean Fosc/4 which is set in the SSPCON1 register. This is controlled via the SPI component property page.
If this does not help then would it be possible to send me the C functions for your C18 program and the FCF and C files from your flowcode program.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 12
- Joined: Sun Mar 11, 2007 6:02 pm
- Location: South Africa
- Contact:
No, in C18 I initialised the SPI in this way:
How do I forward the files to you (to which e-mail address)?
Thanks for your help with this!
Regards
Jan
Code: Select all
Open(SPI_FOSC_64,MODE_00,SMPEND);
Thanks for your help with this!
Regards
Jan
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
You can use the support@matrixmultimedia.co.uk address.
Please can you send the entire set of C18 files and the entire set of Flowcode files.
Also have you tried setting the SPI properties to Fosc/64 as it seems like that is what is happening with the MPLAB program.
Please can you send the entire set of C18 files and the entire set of Flowcode files.
Also have you tried setting the SPI properties to Fosc/64 as it seems like that is what is happening with the MPLAB program.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello Jan
Yes I have recieved the files. I have had a couple of looks through and so far I have not found anything obvious. I will continue to try to find a solution when I get time. I should be able to give it some attention this afternoon. Sorry for the delay.
Yes I have recieved the files. I have had a couple of looks through and so far I have not found anything obvious. I will continue to try to find a solution when I get time. I should be able to give it some attention this afternoon. Sorry for the delay.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 12
- Joined: Sun Mar 11, 2007 6:02 pm
- Location: South Africa
- Contact:
Hi Ben,
I just want to follow up on this SPI issue - could you find anything as to why these functions in Flowcode does not want to work.
Due to time constraints I had to finish my project directly in C18 and MPLAB, which is a pitty as I would really have liked to do this "bit more demanding" project in Flowcode.
But, there will be more projects, and I would still like to know if there is a bug in Flowcode, or whether there is a different way to get this SPI communication to work?
Thanks for your help and feedback!
Best Regards
Jan
I just want to follow up on this SPI issue - could you find anything as to why these functions in Flowcode does not want to work.
Due to time constraints I had to finish my project directly in C18 and MPLAB, which is a pitty as I would really have liked to do this "bit more demanding" project in Flowcode.
But, there will be more projects, and I would still like to know if there is a bug in Flowcode, or whether there is a different way to get this SPI communication to work?
Thanks for your help and feedback!
Best Regards
Jan