Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ Electronics
➜ Microprocessors
➜ Programming the PICAXE 08M
Programming the PICAXE 08M
|
Postings by administrators only.
Refresh page
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Sun 02 Jan 2011 11:15 AM (UTC) Amended on Tue 26 Nov 2013 02:23 AM (UTC) by Nick Gammon
|
Message
| Below is a small video I made of soldering a PICAXE 08M microprocessor with a handful of components, and writing a small program to flash two LEDs in sequence.
The processor has 8 pins:
- Power in (around +3 to +5v)
- Serial in (for programming)
- Port 4 (in or out)
- Port 3 (input)
- Port 2 (in, out, or out for playing a tune)
- Port 1 (in or out)
- Port 0 (in, out, and serial out for programming)
- 0v (common)
More technical details at http://www.rev-ed.co.uk/docs/picaxe_manual1.pdf.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sun 02 Jan 2011 11:57 AM (UTC) |
Message
| This is the program I was running:
symbol red = 1
symbol green = 2
main:
low red
high green
pause 400
low green
high red
pause 400
goto main
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Sun 02 Jan 2011 09:25 PM (UTC) Amended on Mon 03 Jan 2011 06:36 AM (UTC) by Nick Gammon
|
Message
| This is the circuit I used:
The 22k resistor limits the current (from the PC) into the serial input port.
The 10k resistor stops the serial input 'floating' whilst the download cable is not connected. This is essential for reliable operation.
The 220 ohm resistors limit the current to the LEDs (that value is probably a bit high for the 3v battery - something like 100 ohms would give a brighter LED).
You can connect the 3.5 mm jack to a 9-pin (DB9) plug to go into the serial port of your PC. My PC is too new to have a serial port so I used a special USB to serial converter cable instead.
As you can see, pins 3 and 4 are not connected. They could be used for sensors or an additional output.
Once programmed using the "in-circuit" programming technique, the programming cable can be disconnected and the device located wherever it is needed.
Approximate cost of parts
Prices in Australian dollars. At present this is roughly the same as $US.
- PICAXE 08M processor: $3.55
Supplier: http://www.microzed.com.au/
- 3.5 mm stereo jack to plug programming cable into: $0.95
- Battery holder with switch: $2.80
- IC socket: $0.40
- AXE026 programming cable for serial port: $7.95
or
AXE027 programming cable for USB port: $33.95
(If you have an older PC with a serial port the cheaper programming cable is all you need. The AXE027 has an imbedded chip (FT232RQ) and other components inside the cable connector that converts USB to serial).
Of course, the cable can be re-used for future projects.
Alternatively, skip the 3.5 mm jack and the special cable, and simply run some hook-up wire to a DB9 connector and plug that straight into the PC serial port).
- 4 resistors (22K, 10K, 220 ohm x 2): $0.20
- Hookup wire, insulating "spaghetti", and solder: $1.00
- Soldering iron: $13
(If you don't own one already, of course can be re-used for future projects).
- LEDs: $0.20 each.
Based on the above, the whole project can be constructed for under $10, excepting the parts you could re-use many times (the programming cable and the soldering iron).
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Joe Walburn
USA (2 posts) Bio
|
Date
| Reply #4 on Thu 07 Jul 2011 03:39 PM (UTC) |
Message
| What an EXCEPTIONAL little piece of instructional material on the 08M!!!
I am very grateful for the time and thought you have placed in this work. I've scoured the web for something similar, and have come up empty until NOW. As a retired high school physics teacher, I really don't think I could have explained this subject better.
I hope all the readers and forum members appreciate the energy it takes to help others. WELL DONE, Mr. Gammon!
With respect,
Joe Walburn, Athens, OH USA
|
"If we don't hang together, we will most assuredly hang separately." Ben Franklin during dark days of American Revolution | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
29,405 views.
Postings by administrators only.
Refresh page
top