This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi everyone,
To do some additional debugging, I've acquired a $12 logic analyzer, which is compatible with Saleae software.
www.amazon.com/.../
I've attached my recording at the bottom of this post, which you can open via the Saleae logic software:
https://ideas.saleae.com/f/changelog/
The below image shows what we are experiencing. I've taken the main routines (EM_foreground and HMI_statemachine), as well as the interrupts, and added code to status pins up at the beginning of the routines, and down after it has completed the routine. I connected 7 channels to monitor what was going on.
When I try to reduce my command byte 1ms delay, by a factor of 10 (since I'm only at a whopping 1,000 bytes per second, a 10x improvement shouldn't be too bad), I notice the SD24B_VECTOR appears to frequently take 115us to complete the call, during which time, 2 bytes could be sent and one will be dropped.
How can we work around this, so we can send command bytes to the device more quickly?
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/166/2021_2D00_02_2D00_03-MSP430-Dropped-Data.7z
Hi,
From your logic analyzer's graph, the UART will be influnced by SD24 interrupt.
Solution 1. Please check the SD24ISR, is there any long term calculation inside? Please optimized the calculation and move the calculation to main loop (Out of the interrupt.)
Solution 2. Please enable the nesting interrupt in SD24 ISR.
Solution 3: You can try DMA with UART. Enable the DMA trigger from UART. The data can be stored in other address and you can process the received byte later and the data could not be lost.
Generally, I think it can be solved in many ways. Please try a best method.
Thanks Hawken for the ideas,
I think Solution 2 probably is the quickest to implement.
If there is an interrupt inside of the SD24 ISR, will that cause incorrect calculations for the metering routines in EMDC, or will this be okay?
Hi,
Depends.
Please firstly check the UART interrupt cycle time. If there is no multi nesting interrupt, it would be OK. But if the UART interrupt is too long, it would caused a multi nesting, please try solution 1.
You need aware of every interrupt cycle time and decide the 'smart' solution.
**Attention** This is a public forum