Thanks for your suggestions. I corrected the CLROERR microbug, with no effect and then inserted an [LED ON : PAUSE : LED OFF] bit between the byte receive and byte echo lines in the code. This proved that the micro and code were running, with the LED blinking for each byte received. However, after a random number of bytes received (typically 6), the program stops with the LED on.
Tidying up the breadboad wiring and moving the power input lines connection to the board greadtly improves things. Most of the bytes are now echoed correctly, with a few random errors. This all suggests that it is a board layout problem giving noise on the power lines that latches up the micro. The funny thing is that I used 9600 baud with 20MHz, no absolutely problem, when using SEROUT and NO MAX232. It seems that the MAX232 is producing these glitches.
I hope the problem will be fully solved when I go to a PCB. Thanks for the suggestions.




Bookmarks