My main code (updated):
http://pastebin.com/m7513a97d
Includes:
generic_include.inc:
http://pastebin.com/m1be5ca8f
LCD_Init_PortD.inc:
http://pastebin.com/m17a1888d
ADC10:
http://pastebin.com/m3b596568
In my updated code, something bizarre happens. My setup has an optical encoder w/channels A/B. When I start my program, it drops into "Main" after initializing variables and such. Main displays the current position of the encoder. As my code stands, it's fast and normal. The LCD updates w/the correct position at the speed it's supposed to. If I make ONE simple modification, if I comment out DEBUG_STACK declaration on line 30, all of a sudden for no apparent reason, the update rate of the LCD will be 0.5-1s. No idea what's going on. This isn't the only thing to trigger that. If I then comment out the PID_Loop routine, it'll be fast again... I'm so confused and frustrated and I'm not sure wtf is happening. Oh yea, Even if the LCD updates slowly, it still displays the correct position, which tells me that the interrupt service routine is working.
Thanks,
Matt
Bookmarks