Untraceable Serial Port shutdown

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Untraceable Serial Port shutdown

3,059 Views
ddeluca
Contributor I
For some reason, the serial port on the MC9S12DJ256B 80 pin package occasionally shuts down and refuses to respond to input. I fixed the general case, but it still occurs after a power outage. The $#&!(@%& thing is supposed to reset on startup, but occasionally it hangs. I trapped the hang with the debugger, a few times. Twice, I found it pointing to RAM memory, and a third time, it was pointing to the INTERNAL REGISTERS. I set up ENABLE_COP_X at the entry point, but when I checked the associated memory location, it shows this register is disabled, as if it were never set. When it doesn't hang, but operates semi-normally, it occasionally shuts off the serial port. Trapping it with the debugger, makes the problem disappear, without giving a clue what caused the problem in the first place. This is embarassing; it makes us look really bad.
Labels (1)
0 Kudos
2 Replies

472 Views
Technoman64
Contributor III
Have you checked the Errata sheets for your device? I remember reading that are some issues with the SCI and SPI periphials.
 
 
Scroll down until you reach the Errata sheets. Your MCU will have the mask set printed on the chip. Use this to select the correct Errata sheet.
 
These have helped me to solve mystery problems more than once.
0 Kudos

472 Views
ddeluca
Contributor I
Great! I think I had RDRF and OR being set simultaneously in places where interrupts are disabled and an input comes in off the serial port. BDM seems to masquerade this somehow, but I found a workaround where I hold off on initializing the serial ports until after a particular block of initialization code has executed and the interrupts can be enabled. I had removed a Disable Interrupts block from the EEPROM write method, which resolved the issue where the serial port had shut down in the middle of operation, but it was still occurring on startup. Seems to work better now though (fingers crossed).
0 Kudos