We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have a 1ms fixed time interrupt scanning and debouncing a couple of switches, and a 1200 baud port receiving blocks of 17 chars 4 times a sec. Asynchronously at 5 times/sec, I'm assembling an 8 character string to display on an 8 character DM display. This code now uses a vsprintf statement, and occasionally the output string gets leftshifted one character in the buffer. Surrounding the vsprintf call by EA=0 and EA=1 solves the problem, but the resulting delay to my fixed time interrupt messes up the switch scan. Anybody have any clues on why vsprintf is getting upset, and how to get around it? Thanks in advance.
Sorry about the multiple posts. The forum software reported a timeout error, but accepted the post anyway. Seems I'm not the only one with bugs ;->
Well it helps, if one is accumulating a checksum, to do so BEFORE stripping off the parity bit ... More to the point, it seems that getting more stack room solved my problem with vsprintf. I've spent all my embedded years on x86 and 68k, where stack space was the least of my problems. This x51 stuff requires a whole different discipline and strategy. Many thanks to those who offered help. Kudos, too, to Keil for a great optimizing compiler - I guess they take the 'micro' out of 'microcomputer' :-) On to the next problem ...