Where can I find examples of these simple applications
Clint
Posts: 95
I am currently using an SX to do a few simple tasks. With the SX EOL, I need to find a new microcontroller and I want to know how easy/difficult it is to use the Propeller for what I'm doing.
1) Read/count a quadrature encoder
2) Drive an·eight digit·7-segment display LED (or two four digit displays)
3) Trigger events with push buttons, drive LED indicators
4) Drive some type of speaker to make a "beep" sound when needed
Right now I use an interrupt to handle (1) because·a high sampling rate on the encoder is essential to prevent miscounts. With the Propeller architecture, I'm guessing I could dedicate a COG for this, but how would I determine the sampling rate to make sure the Propeller will be fast enough? I see on the Parallax site that each COG can execute 20MIPS. How many instructions will it take to read an encoder and increment a count up & down? Would it be possible to share this task amongst more than one COG to improve the sampling rate? Are there any code examples for handling·quadrature·encoders?
For (2) I currently use a separate IC that statically drives four digits, but if I can save money by using the Propeller to multiplex, it will help offset the increased cost over the SX. For 8 digits this would suck up 7 I/O for the segments and 8 more I/O to sink. I'm not sure how well that many digits would multiplex.
I'm guessing (3) will be a no brainer.
Any examples or suggestions of what type of speaker/sound generator to use for (4) would be helpful. This is to provide a function similar to the beep at the end of cycle for a microwave.
Thank you for any help you can offer. I am also looking at PIC chips, but Parallax and the community has been so great to work with I would hate to go to the dark side.
Post Edited (Clint) : 1/22/2010 6:07:37 PM GMT
1) Read/count a quadrature encoder
2) Drive an·eight digit·7-segment display LED (or two four digit displays)
3) Trigger events with push buttons, drive LED indicators
4) Drive some type of speaker to make a "beep" sound when needed
Right now I use an interrupt to handle (1) because·a high sampling rate on the encoder is essential to prevent miscounts. With the Propeller architecture, I'm guessing I could dedicate a COG for this, but how would I determine the sampling rate to make sure the Propeller will be fast enough? I see on the Parallax site that each COG can execute 20MIPS. How many instructions will it take to read an encoder and increment a count up & down? Would it be possible to share this task amongst more than one COG to improve the sampling rate? Are there any code examples for handling·quadrature·encoders?
For (2) I currently use a separate IC that statically drives four digits, but if I can save money by using the Propeller to multiplex, it will help offset the increased cost over the SX. For 8 digits this would suck up 7 I/O for the segments and 8 more I/O to sink. I'm not sure how well that many digits would multiplex.
I'm guessing (3) will be a no brainer.
Any examples or suggestions of what type of speaker/sound generator to use for (4) would be helpful. This is to provide a function similar to the beep at the end of cycle for a microwave.
Thank you for any help you can offer. I am also looking at PIC chips, but Parallax and the community has been so great to work with I would hate to go to the dark side.
Post Edited (Clint) : 1/22/2010 6:07:37 PM GMT
Comments
The Propeller can do the lot: for example, have a look at the Object Exchange (Obex), which has functions for the
quadrature encoder 'ready to go'.
And you're right to stick with the Parallax community: the forum is second to none!
T o n y
· I don't know if you were using SX/B or not, but if you were you'll feel right at home with my new program PropBASIC.
· It is based on the SX/B compiler.
· You can download it from the first post in the thread http://forums.parallax.com/showthread.php?p=867134
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134·
(4) How fancy do you want to get? The Propeller can generate single tones with one object in the Object Exchange. It can do speech synthesis if you want a talking device. It can play .WAV files as long as they're short enough to fit into memory or can read them from an attached PC-compatible SD card (just needs an SD card socket and 4 I/O pins). The code to do this is also in the Object Exchange. You'll need a small amplifier for the speaker. For simple stuff, a transistor or LM386 amplifier will do just fine.
Bean - I have heard about PropBASIC and I'll definitely look into it. I have been using SX/B and assembly language is over my head right now. The little bit of SPIN I've seen seems to be somewhere in between. If I can transition with PropBASIC and still have the speed I need to accurately read this encoder, I will be happy.
Mike Green - I don't want to get very fancy with the speaker. All I need is a single tone "beep". If there were a device that I can put on a PCB that I could set high for tone and set low for no tone, I would be happy. I want to use as few components as possible.
3. Look at the Propeller Education Kit Labs. It is under help in the Propeller Tool.
4. Also in the Propeller Education Kit Labs.
John Abshier