Shop OBEX P1 Docs P2 Docs Learn Events
Help with my first code using multi cogs. I am a super begginer — Parallax Forums

Help with my first code using multi cogs. I am a super begginer

ELJEQUEELJEQUE Posts: 1
edited 2013-07-08 10:30 in Learn with BlocklyProp
Hi buddies.

I am from Mexico and never I programmed propeller´s chip. It is not common propeller in mexico but I have worked with Pic18f

I have read about the spin code and I have the following code but it doesnt work :/ . I want to do the led blinking wit diferents cogs in diferents pins. I do not what I doing bad.
con_xinfreq=20_000_000
_clkmode= xtal1+pll4x
VAR
long cog1Stack[120]
long cog2Stack[120]
long cog3Stack[120]
long cog4Stack[120]
long cog5Stack[120]
long cog6Stack[120]
long cog7Stack[120]  
PUB HUB
  coginit(1,nucleo1,@cog1Stack)
  coginit(2,nucleo2,@cog2Stack)
  coginit(3,nucleo3,@cog3Stack)
  coginit(4,nucleo4,@cog4Stack)
  coginit(5,nucleo5,@cog5Stack)
  coginit(6,nucleo6,@cog6Stack)
  coginit(7,nucleo7,@cog7Stack) 
    
PUB  nucleo1
 dira[14]~~   
repeat        
!outa[14]   
waitcnt(3_000_000 + cnt)    


PUB nucleo2
 dira[15]~~
repeat
!outa[15]
 waitcnt(3_000_000 + cnt) 
PUB nucleo3
dira[16]~~
repeat
!outa[16]
 waitcnt(3_000_000 + cnt)   
PUB nucleo4
dira[17]~~
repeat
!outa[17]
 waitcnt(3_000_000 + cnt)   
PUB nucleo5
 dira[18]~~
repeat
!outa[18]
 waitcnt(3_000_000 + cnt)  
PUB nucleo6
dira[19]~~
repeat
!outa[19]
 waitcnt(3_000_000 + cnt)   
PUB nucleo7
dira[20]~~
repeat
!outa[20]
 waitcnt(3_000_000 + cnt)

PS:: I using the Gear debugger and also the propeller tool.
PS2: sorry for my poor english , I am not good.

Comments

Sign In or Register to comment.