Page 1 of 1
USART Interrupt
Posted: Tue Jan 19, 2010 6:52 pm
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.
Re: USART Interrupt
Posted: Thu Jan 21, 2010 9:41 am
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.
Re: USART Interrupt
Posted: Tue Jan 26, 2010 1:40 am
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.