Shop OBEX P1 Docs P2 Docs Learn Events
Totally new to parallax — Parallax Forums

Totally new to parallax

edited 2014-11-10 09:25 in Learn with BlocklyProp
I got a propeller P8x32a QuickStart yesterday. I've managed to get the simple IDE installed on my MacBook Air and spent hours trying to find some code to get me started on the learning curve. Simply blinking an external LED would be good. I found some code in the c tutorial on the parallax site. However it states that it will not work with my board. I then tried to wing it assuming that sending pin 26 high would put some voltage on it. This did not work. I cannot figure out what is wrong. Is there something fundamentally different that I am missing here? If I try using example code and the propeller software I get the expected results, so.. the board is good. My few lines of code compiles ok and downloads to the board but no blink. Thanks in advance for any help to get me on my way to learning.

Comments

  • prof_brainoprof_braino Posts: 4,313
    edited 2014-11-09 14:05
    I got a propeller P8x32a QuickStart yesterday....

    Try flashing the built in LEDs, these are p16 to p23 on the Quickstart.

    After you code works, then switch to an external on p26. Eliminating as many unknows as possible at each step is often easier.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2014-11-09 14:13
    Hey rsattaur - welcome to the Parallax forums.

    Like prof_braino said, you may be able to get success by using on of the on board LEDs he listed. Meanwhile, can you post a picture of the setup and the code you are using? That will help us help you figure it out.

    Doc
  • twm47099twm47099 Posts: 867
    edited 2014-11-09 14:26
    Many of the Propeller C tutorials use the peripheral circuits of the Activity Board. The Activity Board has 2 LEDS connected to pins and current limiting resistors. (P26, P27). The QuickStart Board does not have these pins connected to LEDs. The QS Board has 8 Leds connected to Pins 16 - 23 (with current limiting resistors).

    So when using the QS board with the C Learning Tutorials, you would need to check which pins are being used and change them when necessary. The code below changes P26 to P16 and will work on the QS Board. With more complex code that uses circuits prebuilt on specific boards, I will usually used #define or declared constants before main() for the pins so I can easily change them depending on which boards I am using.

    Tom

    /*   Blink Light.c     Blink light circuit connected to P26.
    P26 is built in to Activity Board
    For QuickStart Board, change P26 to P16
    */  
    
    #include "simpletools.h"                      // Include simpletools  
    
    int main()                                    // main function 
    {   
    while(1)                                    // Endless loop   
      {     
    high(16);                                 // Set P16 I/O pin high     
    pause(100);                               // Wait 1/10 second     
    low(16);                                  // Set P16 I/O pin low     
    pause(100);                               // Wait another 1/10 second   
      } 
    }
    
  • edited 2014-11-10 04:22
    Thank you for getting back to me so soon. Using Pin 16 does indeed blink an LED; however that led is also on the QS board (far right from the USB input). I'm looking for the ability to affect something external to the board.
    here is the code being used:

    Blink light circuit connected to P16.
    */


    #include "simpletools.h" // Include simpletools
    #define int led=16;


    int main() // main function
    {
    while(1) // Endless loop
    {
    high(led); // Set P26 I/O pin high
    pause(100); // Wait 1/10 second
    low(led); // Set P26 I/O pin low
    pause(100); // Wait another 1/10 second
    }
    }

    This is basically baby stuff. I've tried using other pins but still get no results. My LED is on a breadboard with the anode connected to the referenced pin. The cathode connects through a 100 ohm resistor and back to ground.

    You mentioned: "you would need to check which pins are being used and change them when necessary. " How would I set about doing this? Do you have some link I could follow perhaps. I'm getting rather confused as this should be a very basic ability for the board. Perhaps there is something fundamental that I'm missing or failing to understand. Or.. maybe the board is bad (despite the fact that I can blink the built in LEDs). Thank you again
  • prof_brainoprof_braino Posts: 4,313
    edited 2014-11-10 06:49
    ...
    This is basically baby stuff. I've tried using other pins but still get no results. My LED is on a breadboard with the anode connected to the referenced pin. The cathode connects through a 100 ohm resistor and back to ground.
    ...

    This is just me talking, and I cannot properly diagnose your hardware without seeing it. BUT I can recall doing similar in the past. So here goes...

    1) if the code flashes the onboard LED, the code works.
    2) changing the pin from 16 to any other unused pin will get the exact same result. Try the other LEDs up to 23 to verify.
    3) an LED on 26 will light if its connected properly. If it does not light, that is a high probabliity that tit is NOT connected properly
    4) Does the LED light when the wire is moved from pin 26 to Vdd? this will show if the LED is good.
    5) is the LED lighting for too short a period? IF the LED requires more juice, try changing from 100 ms to 1000 ms. I often find it really is lighting, but too dim to see. If I use a 4.0 volt LED instead of a 3.3 v LED, it can behave oddly.

    That's all I got for now.

    Oh yeah, check the Go Advanced button and see how to put [code] tags in around your code snippets. I makes it easier to help you.
  • edited 2014-11-10 07:08
    Thank you again. 1) The on board LEDs do flash so code is OK. 2) Changing code to other on-board LEDs also works. 3) I will check connections. Perhaps it is connected improperly. 4) LED does light when wire is moved from pin to vid. So the LED is good. 5) a good thought which never occurred to me. I'll try to increase lighting time and let you know the results. One thing I should mention. I have now tried connecting a multimeter to see what voltage the referenced pin gets when high and it never showed more than .1 v. So with the program running it would read 0 then .1 then back to 0. This also seemed odd to me as I expected a higher voltage (3v or so). Thanks again. I'll let you know what transpires.
  • edited 2014-11-10 07:27
    amendment. I went back and checked the multimeter readings. Not .1 v as previously stated it was actually .o3v. and during this check the voltage does not vary but remains constant at .03v. The referenced pin in this case was pin 24.
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-11-10 08:01
    Make sure you are connected to the proper pins.

    The connector pin labeled 1 is actually Propeller Pin 0 (P0), the pin labeled2 is Propeller Pin 1 (P1)

    The even numbered pins go along the side labeled 1 (P0, P2, P4....P26) the odd numbered pins go along the side labeled 2 (P1, P3, P5...P27)

    This little guide will give you the proper pin #s.

    As everyone has said if your code blinks P16 LED and you change it to P26 *AND* have a working LED hooked up to P26, you should be good to go!
  • edited 2014-11-10 08:15
    You're the man. The problem was pin numbering. The scheme seems somewhat insane as to labelling. Thank you so much. Now I know something new and can finally move forward. I would never have guessed that the labelling on the board bears no relationship to the actual PIN numbers. Your help was greatly appreciated.
  • PublisonPublison Posts: 12,366
    edited 2014-11-10 08:23
    You're the man. The problem was pin numbering. The scheme seems somewhat insane as to labelling. Thank you so much. Now I know something new and can finally move forward. I would never have guessed that the labelling on the board bears no relationship to the actual PIN numbers. Your help was greatly appreciated.

    Glad you got that worked out. Here is an item that has save me a great deal of time:

    http://www.parallax.com/product/721-00017
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-11-10 08:32
    Glad you are up and running. It was the voice of experience - I've plugged things into the WRONG QuickStart pin many times!!

    The connector numbers do make sense when you need to take it back to the schematic for some reason - then you see that connector pin #1 is Propeller P0. When you want to quickly plug something into P17, it's not so helpful!
  • prof_brainoprof_braino Posts: 4,313
    edited 2014-11-10 08:54
    mindrobots wrote: »
    This little guide will give you the proper pin #s.

    Sorry I didn't think of this. I've had this exact issue, and now I have a big bag of the pin finders, and put one one every quickstart. Its a LOT easier than putting masking tape on the header and hand-labeling the connectors, although I did use the masking tape method before laser cutters came to my neighborhood.

    Now that you are an expert, what project are you going to build?
  • edited 2014-11-10 09:03
    Just like to extend my thanks to everyone on this thread for the help given.
  • edited 2014-11-10 09:07
    Far from being an expert. I got the board discounted at radio shack ($7.47) and thought I'd try it out. It will probably take me some considerable time to get up to speed. I started thinking of using it for a retro PC project and saw some posts that may be helpful. However time as always is short and passes too quickly. I don't know when I'll get to it.
  • prof_brainoprof_braino Posts: 4,313
    edited 2014-11-10 09:12
    In that case you are in luck. Oldbitcollector has a board that coverts the quickstart to a standalone BASIC computer, the same hardware can be used for a JupiterACE FORTH computer, and the guys at Hive-project.de have a full on 3 prop build that's pretty awesome. There's a zillion choices! What direction were you looking to go?
  • edited 2014-11-10 09:25
    Not really sure. My first PC was an Apple II. I used to also play with what was then Radioshack's TRS-80 mod. i and II and III. Then moved up in the world to other things.They all had one thing in common though, 80X24 lines. with pixels using up the same space as a character. You had to write concisely to minimize the ram used. I also like woodworking and had the thought of maybe a small computer in a wooden (maple burl perhaps) case with small monitor on top to run games and such from the late 70's and early 80's. I've seen a lot of stuff while surfing the web but it's early days yet. I have a lot of thinking and planning to do. Not to mention learning the ins and out of the propeller platform.
Sign In or Register to comment.