USART Interrupt

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Brian Walsh
Posts: 29
Joined: Thu Jan 14, 2010 10:43 pm
Has thanked: 3 times

USART Interrupt

Post by Brian Walsh »

I'd like to buffer incoming RS232. Can anyone point me to an example of Rx Int. In particular, do I need to fiddle with registers directly or does the INT box do it all automatically.

Thanks,

Brian.

User avatar
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: USART Interrupt

Post by Benj »

Hello Brian

No you shouldn't have to mess about with any code to drive registers. The only thing you may have to do is perform a RS232 read before you activate the interrupt. This ensures that any errors on the bus that occur on startup are cleared.
Attachments
RXINT_Example.fcf
(7.5 KiB) Downloaded 421 times

Brian Walsh
Posts: 29
Joined: Thu Jan 14, 2010 10:43 pm
Has thanked: 3 times

Re: USART Interrupt

Post by Brian Walsh »

Ben,

Thanks for the sample program. I've not got it working yet and, during my attempts to do so, I've come across some anomalies. These are noted below.

When the simulation is started all port A leds are on, presumably indicating RCREG = 255, whereas the reset value for RCREG is 0 under all circumstances according to my interpretation of the data sheet.

The RA0 pin on the chip window diagram (both 16F88 in your example and 18F4620 in my target) is coloured green which, I assume, designates an analogue input, but all port A pins are digital outputs in the example. At the end of the simulation A1:A7 show the correct final states for the port in red and blue but A0 remains resolutely green. (Please point me to a colour code example if you can DI/DO/AI/Reserved).

The simple chip configure window shows the oscillator type as XTAL and the expert as HS. Should the OSC1 (A7) & OSC2 (A6) pins in the chip window diagram not be white indicating their unavailabilty as I/O? Alternatively, should not both the chip configuration windows show these pins as allocated to I/O with the oscilator type as internal RC?

Lastly, do you consider that serial communications based on Microchip's internal RC oscillator will be sufficiently robust over the full temperature range?

tia

Brian.

Post Reply