Help Needed Programming the Propeller in C
jdambri1
Posts: 17
I am new to the propeller, and was wondering if someone one could help me with basic programming using ICC v7. The main thing I would like help with is reading from pins. For instance I want to connect a photo-transistor. Thus I need to see if the there is a high input or low input. How would I do this. Appreciate any help
Comments
This should work.
You should download this app note and look at ADC.spin with the Propeller Tool:
http://www.parallax.com/Portals/0/Downloads/appnt/prop/AN001-PropellerCountersv1.2.zip
The plain text description and schematic in ADC.spin should be enough to help you understand what to do (components should be kept as close together as possible).
The Propeller Tool converts Parallax font for the schematic into something readable. The Propeller Tool and other resources can be found here: http://www.parallax.com/ProductInfo/Microcontrollers/PropellerGeneralInformation/PropellerMediaPage/tabid/832/Default.aspx
Just mask off (or shift) the bits you don't want - e.g:
Ross.
http://obex.parallax.com/objects/?o=9&ot=asc ...
You can use your favorite text editor to look at the ICC examples.
If you want to download Catalina and look at it's examples, go here: http://catalina-c.sourceforge.net/
Sadly there is no Propeller LMM GCC port We are working on a variation of GCC.
So for all the developers in the world spoiled by GCC, there is hope.
You may have to adjust "pin" number in the tvText_start statement to match your hardware. The pin is the first pin number of the 4 contiguous pins used in the TV DAC resistor circuit.
http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/PropellerDatasheet-v1.2.pdf
Where did you get the 1.65V from? Measurement?
Jim
What do you have connected to your outputs?
Jim
Relays are generally current threshold devices. It may be that your relay simply draws too much current for operating. You need some kind of external transistor to switch on the relay. Look at Nuts and Volts Column #6 for examples of this for the Stamp. The same solutions work for the Propeller except that transistor base resistor values will be different (smaller) because of the different supply voltage.
Regarding the fluctuating output voltage. You probably have a problem with your power supply. It's really impossible to tell with the small amount of information you've provided. We really need a schematic and a listing of your program.
I apologize for the little information, but you were right it was a bad batter. Thanks again for your quick reply and advice , truly appreciate it.
The following is the code I use to output to pin 17.
DIRA =1 << 17 ;
OUTA ^= DIRA;
What is connected to the input?
And no, voltages are not compiler dependent.
Nick