Small C: SCI interrupt-driven receive example

Started by David D November 19, 2002
I've hacked at the SCI echo example in the original
release of the Small C port so that the
SCI receive portion is interrupt driven.

The resultant assembly output of the compiler needs
to be edited so that the interrupt service routine
ends with an RTI instruction instead of an RTS
instruction. The vecinit.asm file needs to be
edited to point the appropriate vector to the ISR.

The interrupt service routine needs to change global
variables for the change to be seen by the main
program. There are more elegant and faster
ways to do both of these, but as it is, the Small C
compiler port can be used with interrupts. The
ultimate would be to add RTI support which is lacking
in Small C out of the box from the original source
(see CC4.c where the assembly instructions for the
p-codes are).

The attached zip file contains the C source, the
modified vecinit3.asm and testsci3.asm.

Happy hacking.



Attachment (not stored)
Type: application/x-zip-compressed