Hi Guys
I have never used interrupts before and I'm trying to understand them, I have written a small program just to see how this works but i cant get the RXINT interrupt to work when i send data via RS232 can anyone look at the attached program and tell me where I'm going wrong???
Brian
RXINT
Moderator: Benj
- 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:
Re: RXINT
Hello Brian,
Your program looks ok but your configuration does not. Please ensure that both your configuration and clock speed are correct. You can do this by creating an endless loop that outputs a 1 to a LED, waits a second then outputs a 0 and then waits another second. When the delays on the hardware equal 1 second then you have everything correct and your baud rate for the UART should then work correctly to receive data.
Your program looks ok but your configuration does not. Please ensure that both your configuration and clock speed are correct. You can do this by creating an endless loop that outputs a 1 to a LED, waits a second then outputs a 0 and then waits another second. When the delays on the hardware equal 1 second then you have everything correct and your baud rate for the UART should then work correctly to receive data.
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
- jollybv
- Flowcode v5 User
- Posts: 376
- Joined: Thu Feb 12, 2009 5:20 am
- Location: Cape Town
- Has thanked: 81 times
- Been thanked: 25 times
Re: RXINT
Hi Ben
Not quite sure what you mean, I understand I had my clock speed set to RX not HS and the RS232 properties the Baud rate = 9600, the Tx/Rx = UART1, data bits = 8, Char Receive = Byte (legacy) Rx time out = LegacyI understand putting the led in an endless loop 1s on, 1s off but how will I know "When the delays on the hardware equal 1 second" where will i find this to get my baud rate for the UART
Brian
Not quite sure what you mean, I understand I had my clock speed set to RX not HS and the RS232 properties the Baud rate = 9600, the Tx/Rx = UART1, data bits = 8, Char Receive = Byte (legacy) Rx time out = LegacyI understand putting the led in an endless loop 1s on, 1s off but how will I know "When the delays on the hardware equal 1 second" where will i find this to get my baud rate for the UART
Brian
- 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:
Re: RXINT
Hello,
If your flashing a LED then you can time in your head to see if the LED is roughly on for a second. It should be fairly obvious when the timings are working correctly.
1) Ensure that the clock speed in project options matches your crystal speed.
2) Ensure that the configuration settings are correct eg HS oscillator, watchdog disabled etc...
All the configuration settings are described in the device datasheet.
Once you have the hardware running correctly then RS232 should just work.
If your flashing a LED then you can time in your head to see if the LED is roughly on for a second. It should be fairly obvious when the timings are working correctly.
1) Ensure that the clock speed in project options matches your crystal speed.
2) Ensure that the configuration settings are correct eg HS oscillator, watchdog disabled etc...
All the configuration settings are described in the device datasheet.
Once you have the hardware running correctly then RS232 should just work.
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
- jollybv
- Flowcode v5 User
- Posts: 376
- Joined: Thu Feb 12, 2009 5:20 am
- Location: Cape Town
- Has thanked: 81 times
- Been thanked: 25 times
Re: RXINT
Hi ben
Sorry you might have go me wrong..?? I have "NO hardware" for this device all I'm trying to do is check how the interrupt works in the simulation. I have put a toge point in the RXINT macros to see if the interrupt is executed when I type in the "Char in Queue" but this dose not seem to work and see the interrupt.
Sorry you might have go me wrong..?? I have "NO hardware" for this device all I'm trying to do is check how the interrupt works in the simulation. I have put a toge point in the RXINT macros to see if the interrupt is executed when I type in the "Char in Queue" but this dose not seem to work and see the interrupt.
- 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:
Re: RXINT
Ah I see,
Ok that explains things. I don't think that the RXINT works in simulation, should work correctly on hardware, sorry for any inconvenience.
Ok that explains things. I don't think that the RXINT works in simulation, should work correctly on hardware, sorry for any inconvenience.
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