Totally new to parallax
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
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.
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
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
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
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.
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!
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
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!
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?