Other Parts Discussed in Thread: HALCOGEN
Hi,
I am currently working on a project around the TMS570LS3137ZWT Hercules Dev Kit. I need to set up the LIN (in SCI mode) module to work as a UART. Normal program flow must be interrupted upon receiving data, to set it in some buffer.
HALCoGen is used to produce code in the following configuration:
- SCI2 driver enabled
- RX INT enabled in SCI/LIN Global
- SCI/LIN Data Format set to fit project, corresponding to setting on PC side
- TX pin set to output direction in SCI/LIN port, both RX and TX pin SCI, pullup mode
- VIM channels 13 and 24 enabled, IRQ (strangely enough, I don't seem to have to call vimInit() for the interrupts to work)
A problem arises when data is received. A single byte is sent from a PC and it is seen and retrieved by the SCI RX interrupt. After that, the interrupt loops, i.e. it is continuously triggered.
Attached is a minimal code snippet that produces this error. "controller_main.h" only contains prototypes of functions ControllerMain() and UponSCIReceive(). ControllerMain() is called in main(), in "sys_main.c" (nothing else happens there). UponSCIReceive() is called in sciNotification() if the flag is SCI_RX_INT (nothing else happens there). No other SCI interrupt than SCI RX are enabled. Interrupts have succesfully been used to implement a HET timer and other things (not shown in the snippet). The looping causes sciSend() or whatever code placed in UponSCIReceive() to be continously executed.