Shop OBEX P1 Docs P2 Docs Learn Events
code test — Parallax Forums

code test

mynet43mynet43 Posts: 644
edited 2010-11-16 09:39 in General Discussion
Why did they take the old icons out of the new forum?! I can never remember how to insert code into a post :(

[/code]


'========================
'Spin program works on the Demo Board
'compile into the EEPROM using F11
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
D_TX = 30
D_RX = 31
D_BAUD = 115200

OBJ
D : "FullDuplexSerial" 'serial driver

PUB Main
dirA[23..16]~~
D.Start(D_RX,D_TX,0,D_BAUD) 'start the serial driver
repeat 5
outA[23..16] := %10101010
waitcnt(clkfreq/4+cnt)
outA[23..16] := !(%10101010)
waitcnt(clkfreq/4+cnt)
outA[23..16]~
repeat
OutA[23..20] := InA[7..5] 'output = input
D.Tx(InA[7..5]) 'transmit the value to RB
[code/]

Comments

  • mynet43mynet43 Posts: 644
    edited 2010-11-16 09:35
    Well that didn't work, so try it the other way.

    [code/]

    '========================
    'Spin program works on the Demo Board
    'compile into the EEPROM using F11
    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    D_TX = 30
    D_RX = 31
    D_BAUD = 115200

    OBJ
    D : "FullDuplexSerial" 'serial driver

    PUB Main
    dirA[23..16]~~
    D.Start(D_RX,D_TX,0,D_BAUD) 'start the serial driver
    repeat 5
    outA[23..16] := %10101010
    waitcnt(clkfreq/4+cnt)
    outA[23..16] := !(%10101010)
    waitcnt(clkfreq/4+cnt)
    outA[23..16]~
    repeat
    OutA[23..20] := InA[7..5] 'output = input
    D.Tx(InA[7..5]) 'transmit the value to RB
    [/code]
  • mynet43mynet43 Posts: 644
    edited 2010-11-16 09:36
    Well that didn't work either!

    Grrrr... #@$%@#^@%$#@$

    Help!
  • mynet43mynet43 Posts: 644
    edited 2010-11-16 09:38
    OK, one more time!
     
    '========================
    'Spin program works on the Demo Board
    'compile into the EEPROM using F11
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
     D_TX      = 30
     D_RX      = 31
     D_BAUD    = 115200
     
    OBJ
      D    : "FullDuplexSerial"    'serial driver
     
    PUB Main
      dirA[23..16]~~
      D.Start(D_RX,D_TX,0,D_BAUD)   'start the serial driver
      repeat 5
        outA[23..16] := %10101010
        waitcnt(clkfreq/4+cnt)    
        outA[23..16] := !(%10101010)
        waitcnt(clkfreq/4+cnt)
        outA[23..16]~
      repeat
         OutA[23..20] := InA[7..5]  'output = input
         D.Tx(InA[7..5])      'transmit the value to RB
    
  • mynet43mynet43 Posts: 644
    edited 2010-11-16 09:39
    Finally, it worked!

    Would someone PLEASE put these tools back in!

    Thanks!
Sign In or Register to comment.