futz
Active Member
I have the Junebug controlling two servos (using modified Mike, K8LH's 8-servo algorithm that I found here) driving a pan-tilt, my CMUcam and a 2-wire LCD. All works pretty well at 19200 baud, but that data rate is unacceptably slow. So I rewrote for high-priority interrupt-driven receive at 115200 baud, and put the servo updates as low-priority.
If I disable the servo interrupt that works fine, but when I turn on that second interrupt things fall apart. The code still seems to still sorta be alive in there - the servos twitch a bit when the ball is in front of them, but otherwise they aren't under my control and just wander around aimlessly. The LCD displays gibberish, only occasionally flashing something sensible.
Though it might be something dumb in my code, I suspect 115200 baud may be a bit much to ask of an 18F1320 running on the 8MHz internal clock. Do you think I should move to an 18F1320 on a breadboard with 20MHz clock?
If I disable the servo interrupt that works fine, but when I turn on that second interrupt things fall apart. The code still seems to still sorta be alive in there - the servos twitch a bit when the ball is in front of them, but otherwise they aren't under my control and just wander around aimlessly. The LCD displays gibberish, only occasionally flashing something sensible.
Though it might be something dumb in my code, I suspect 115200 baud may be a bit much to ask of an 18F1320 running on the 8MHz internal clock. Do you think I should move to an 18F1320 on a breadboard with 20MHz clock?
Last edited: