Shop OBEX P1 Docs P2 Docs Learn Events
Serial Issue — Parallax Forums

Serial Issue

electric550electric550 Posts: 122
edited 2009-08-05 05:29 in Propeller 1
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?

'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

  • JonnyMacJonnyMac Posts: 9,197
    edited 2009-08-05 05:29
    16 x 8 MHz is 128 MHz which is beyond the Propeller spec and causing it to behave unreliably. Get a 5 or 6.25 MHz crystal as these are safe to run at 16x.
Sign In or Register to comment.