AnsweredAssumed Answered

ADuC845 SPI interface with Max3109 dual UART IC

Question asked by sean73 on Aug 2, 2012
Latest reply on Aug 3, 2012 by sean73

Hello, I am working on an embedded project involving the ADuC845 micro and the MAX3109 dual UART IC. I am using the Keil development tools as my IDE for this project. The interface between the ADuC845 and the MAX3109 is SPI. The ADuC845 is configured as the master and the MAX3109 is configured as the slave. I have the low level SPI interface working properly with the various registers in the MAX3109 to transmit and receive RS232 data on either of the UARTS provided in the part. I am now working on integrating the ADuC845's INT1 ISR for the IRQ line from the MAX3109 into my code to allow the micro to asynchronously clock characters out of either UARTs as they are received and load them into software buffers within the ADuC845. These buffers will then be scanned for matching know commands keyed off the presence of carriage return and line feed. My goal is to implement a command parser between the ADuC845 and both of the MAX3109 UARTs.


I am using the INT1 P3.3 on the ADuC845 part to detect when the IRQ line from the MAX3109 goes low. The IRQ line is active low and pulled high through a 10K resistor to Vcc. Within this INT1 interrupt routine I call the SPI functions to clock out the necessary number of characters stored in the MAX3109's RX FIFOs.


I am getting linker warnings (L15) stating the possibility of multiple calls to my SPI function segments. I have done some reading on this linker warning and I think I understand why I am receiving it. However, I am not sure I know how to manage the SPI interaction between the ADuC845 and the MAX3109 (triggered from the IRQ line going low for receiving bytes) to prevent this possible event?


Its possible that the code could be in the process of using the SPI functions to TX characters out either of the MAX3109 UARTS, when the IRQ line goes low signifying RX characters to be clocked out of the MAX3109 part. At that time there could be the possibility for the SPI functions executing from main code then being called again from the INT1 routine. Perhaps its as simple as disabling the INT1 interrupt in my code whenever characters are transmitted out either of the MAX3109 UARTS? This way there isn't the possibility of the SPI functions being called from the INT1 routine while already executing from the main code loop.  


I appreciate any suggestions on how to architect a command parser mechanism using the SPI interface between the ADuC845 and the MAX3109 dual UART IC.


thank you,