Just stumped trying to figure out why my code doesn't run. I tried to write one of my first programs, and when I figured out it was not working I attempted at a little debugging. I commented out the lines one by one to try to isolate the problem, and so here is the condensed code (no comments).
The CK method appears to be what is causing the program to hang up. There is an LED on pin 11 which should turn off if the program runs to the end, and it doesn't as soon as I add the CK(10,10) method. It is the waitcnt command specifically because as soon as I remove it, it all works, and the light turns off. The LCD, however, is another matter.
What a brain-tease.
_xinfreq = 5_000_000
_clkmode = xtal1 + pll1x
uS = (5)
mS = (5_000)
DirA := %00000000_00000000_0000_1111_1111_1111
OutA := %00000000_00000000_0000_0000_0000_0000 ' Set Control and data ports as outputs
OutA := %1
OutA[0..1] := %00
OutA[10..3] := %0011_0000
CK(10,10) ' Trigger the clock pin. check clock for required pulse width and time.
OutA := %0 ' Turn off led to confirm program ran to end. !Not the case.
PUB T_Del(dt, x) 'waits until cnt register equals expression.
waitcnt(dt*x + cnt) 'dt = time step x = multiplier
PUB CK(Toff,Ton) ' Method to pulse the CK Pin on the LCD
waitcnt(Toff + cnt)