Shop OBEX P1 Docs P2 Docs Learn Events
Beginner Propeller Help Cannot Set Pins — Parallax Forums

Beginner Propeller Help Cannot Set Pins

dtrethdtreth Posts: 3
edited 2011-05-11 07:21 in Propeller 1
I think my propeller board is bad or something. I cannot get pins to go high or low, they just float. However, I have an xbee hooked up to pins 5,6 and 7, and using serial_pass_through X-CTU can see the XBee just fine, and it works just fine. The prop seems to program just fine, too, but I cannot get the 30,31 pins to drive high or low either.
CON
  _clkmode = xtal1 + pll16x                           
  _xinfreq = 5_000_000                         


pub main
  dira[7] := 1
  outa[7] := 1
It's about as simple as it gets for a program, but when I use a DVM, it's 0V from Vss and 0V from Vdd. ????????

Thanks for your help in advance guys.

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-05-11 02:23
    When the SPIN interpreter reaches the end of the main method it shuts down the cog. So you'd have to be really fast to spot the high on pin 7. What it boils down to is you have to keep the cog alive which means you should add either an empty repeat statement or a waitpne(0, 0, 0).
    CON
      _clkmode = xtal1 + pll16x                           
      _xinfreq = 5_000_000                         
    
    
    pub main
      dira[7] := 1
      outa[7] := 1
    
      waitpne(0, 0, 0)
    
  • dtrethdtreth Posts: 3
    edited 2011-05-11 02:48
    !!!!!!!!!!!!!! THANK YOU SO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (excessive I know but I am elated to know that I am not a complete nutcase)
  • RaymanRayman Posts: 14,877
    edited 2011-05-11 06:35
    This got me too, when I was starting out... I wonder if it would be better if the Prop Tool automatically inserted a "repeat" at the end of the main procedure at compile time...
  • LeonLeon Posts: 7,620
    edited 2011-05-11 06:39
    Some C compilers jump to an infinite loop when exiting main.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2011-05-11 06:46
    I have fallen for that trap many times, so now i just add repeat lines very liberally...I am sure you know how to blink LED's right? That is like the first program you should test:)
  • dtrethdtreth Posts: 3
    edited 2011-05-11 06:50
    I have fallen for that trap many times, so now i just add repeat lines very liberally...I am sure you know how to blink LED's right? That is like the first program you should test:)

    If I had any LED's
  • RavenkallenRavenkallen Posts: 1,057
    edited 2011-05-11 06:54
    @dtreth...... WHAT!!!?? You don't have any LED's? You must go to radio shack and purchase a few. They are essential to almost EVERY project and they provide the most basic of visual feedback. Plus, they look really cool to:)
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-05-11 07:21
    If your are a beginner and don't have many preconceived notions you may be open to other options.

    If you want an interactive environment you might consider the FORTH option (Google propforth)

    It's not as popular as C but makes for very quick development cycles.
Sign In or Register to comment.