Serial Issue
So when I run the following code with 8Mhz crystal at 8Pll it works fine and increments number in serial terminal slowly, but when I use a 16pll the numbers print out with leading zeros and it prints out a bunch of times instead of one time for each number. The numbers seem to incriment at the right times but each interval is printed out hundreds of times. I am confused as to how this is happening. hardware? Software?
With 8xpll The output in terminal is
1
2
3
4
.
..
...
with 16xpll the output in terminal is
0000000001
00
0000000002
01
0000000002
01
...
...
...
...
0000000003
02
0000000003
02
...
...
...
...
0000000004
03
........and so on.
Any help is appreciated. I am not sure why it is happening. Thanks!
'CON
_clkmode = xtal1 + pll16x 'Run at the full 80MHz
_xinfreq = 8_000_000
OBJ
serial : "fullduplexserialplus"
DAT
Ch0 word 1
Ch1 word 1
Ch2 word 1
Time long 1
oneten byte 1
VAR
long stack[noparse][[/noparse]40]
PUB start | counter, val, count
'infrared.start(18,17,19)
'serial.start(25,24,0,115200)
serial.start(31,30,0,115200)
count := 0
repeat
repeat while count < 500000
count := count + 1
count := 0
counter := counter + 1
serial.dec(counter)
serial.tx(10)
serial.tx(13)
With 8xpll The output in terminal is
1
2
3
4
.
..
...
with 16xpll the output in terminal is
0000000001
00
0000000002
01
0000000002
01
...
...
...
...
0000000003
02
0000000003
02
...
...
...
...
0000000004
03
........and so on.
Any help is appreciated. I am not sure why it is happening. Thanks!

Comments