Some advice for a PicAxe amateur

itolond

New Member
Dear all need some advice on crating a 'solution' using PicAxe

I want to create a 'setup' for the following:

  1. create 3 strobe lights (LED) (independent sequence for each)
  2. control 2 motors using PWM (start up, run and shutdown / motors will run at differing speeds)
  3. landing lights operation (on of off only)
  4. operate sounds unit (play, loop next song stop)

I would like to (preferably) operate these from infrared control, which would ...

Initiate startup (sound, motors and lights sequence)
Initiate shutdown (sound, motors and lights sequence)
turn landing lights on or off (toggle)

I understand how to achieve this using individual PICAxe chips, but given space and efficiency needs, what would be base soluton in terms of # of micro processors and micro processor size.


Thanks for the help in advance
 

geoff07

Senior Member
Though you could probably do all of this with one big chip (except perhaps the IR) I would be tempted to use dedicated 08M2 Picaxes for simplicity of the code, given the low cost of an 08M2. One to sit waiting to receive the IR and interrupt the appropriate action chip to tell it what to do. Others to control the strobes, PWM, lights and sounds. Much will depend on the hardware, for example, how will the sounds by controlled? What sort of strobe pattern, and can the timing be done accurately enough by a single 08M2 with several threads?
 

erco

Senior Member
IMO the 20M2 is the best chip to get, ~$4. The 08M2 is nearly $3 with a lot fewer pins, so I just stock up on 20M2s. Unless physical size is a real issue. If you don't know, you can plug an 08M2 and 14M2 into a board designed for a 20M2. Same power & programming pinouts. The 18M2(+) has the oddball pinout.

You can do a few things "simultaneously" via multitasking at 4 MHz, but you can likely do more not multitasking at a higher speed with a properly written program. I doubt if you need one chip per task; unless your program's timing demands are critical, you can probably use one 20M2.

IMO the PicAxe's surprising weak spot is that generating sound stops all the other processes. A PAUSE doesn't. PWM doesn't. Managing 8 servos doesn't. Not sure why generating sound couldn't be a background operation that wouldn't stop everything else from going on.
 

itolond

New Member
Hi
Thanks for the info. I do have a small space and need to keep things optimized. The sound would be controlled by picAxe but use. Mdfky SE card sound unit. So in principle it should look something like:
Play track 001, on finish ( or time) loop track 2

Strobe pattern is very simple again. E.g. Strobe a second for .5 seconds

I am not sure how the communication would load the micro, so hence the questions.

My biggest question mark is I/r communications. I understand this is a power draw and must cycle ( 38hz) on the receiver ( correct)
 

Jamster

Senior Member
A simple trick I used was to have a loop running checking the IR with a timeout of 1ms, so long as there's not too much happening in the loop you wont miss the data and it allows you to run other tasks at the same time, can do it on multitasking as well :)
 
Top