Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Quick diagnostic board — Parallax Forums

Propeller Quick diagnostic board

RagtopRagtop Posts: 406
edited 2013-03-25 09:08 in Robotics
A small project to help me quickly assess the functionally of my many ill treated propeller chips. I believe this is my first time using SMD components.

The code
CON
         _clkmode        = xtal1 + pll16x
         _xinfreq        = 5_000_000
   
VAR

  long pin
  long low,high
  long Stack[16] 
OBJ
    'screen : "debugger"      
PUB startledcog

   cognew(Timing,@Stack)
   
   low := 1
   high := 27
   pin := low
   dira[low..high]~~
   high++
   blinkled

Pub Timing
    dira[0]~~
    repeat
       !outa[0]
       waitcnt(clkfreq + cnt)
PUB Blinkled
   repeat
       dira[pin]~~
       repeat until pin == high
           
          !outa[pin]
          pin++
          waitcnt(clkfreq/15 + cnt)
       waitcnt(clkfreq + cnt)   
    pin:=low

Comments

  • VideomachineVideomachine Posts: 9
    edited 2013-03-25 09:08
    You can test every Parallax Board with P8X32 with the following software in ViewPort.

    Here the code:
    ''Quick-Diagnose-Board''
    ''An allen Ports leuchten die ''
    ''Leds nacheiander auf!von P0 bis P29''




    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000

    VAR
    long _vpio 'Stores realtime IO measurements


    long pin
    long low,high
    long Stack[16]
    long bit0,bit29

    OBJ
    'screen : "debugger"
    'include 1 ViewPort object:
    vp : "Conduit" 'transfers data to/from PC



    PUB startledcog
    vp.config(string("var:io(bits=[pin[0..29],30tx,31rx]),freq(unit=kHz,f=0.001*x,min=1,max=10)"))
    vp.config(string("start:mixed"))


    vp.monitorina(@_vpio) 'sample the IO port into _vpio
    vp.share(@_vpio,@bit29) 'share memory between _vpio and bit29


    cognew(Timing,@Stack)

    low := 1
    high := 29
    pin := low
    dira[low..high]~~
    high++
    blinkled


    Pub Timing
    dira[0]~~
    repeat
    !outa[0]
    waitcnt(clkfreq + cnt)

    PUB Blinkled
    repeat
    dira[pin]~~
    repeat until pin == high

    !outa[pin]
    pin++
    waitcnt(clkfreq/15 + cnt)
    waitcnt(clkfreq + cnt)
    pin:=low


    Many greetings
    O. John
Sign In or Register to comment.