Silicon ChipPICAXE Project Development System - July 2010 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Today's TV - brilliant pictures, mediocre sound
  4. Feature: Electronics Goes Boating by Kevin Poulter
  5. Feature: 3DTV: From Stadium To Living Room by Nicholas Vinen
  6. Feature: Programming PIC Microcontrollers: How It’s Done by Mauro Grassi
  7. Project: An Intelligent 12V Fan Controller by Geoff Graham
  8. PICAXE Project Development System by Jeff Monegal
  9. Project: Lab-Standard 16-Bit Digital Potentiometer by Jim Rowe
  10. Project: Dual-Tracking ±19V Power Supply, Pt.2 by Nicholas Vinen
  11. Vintage Radio: Reflex receivers: why they were necessary by Rodney Champness
  12. Advertising Index
  13. Outer Back Cover

This is only a preview of the July 2010 issue of Silicon Chip.

You can view 28 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "An Intelligent 12V Fan Controller":
  • Intelligent 12V Fan Controller PCB [18107101] (AUD $5.00)
  • PIC18F2550-I/SP programmed for Intelligent 12V Fan Controller [1810710A.HEX] (Programmed Microcontroller, AUD $20.00)
  • Firmware and PC software plus source code for the Intelligent 12V Fan Controller [1810710A.HEX] (Free)
  • Intelligent 12V Fan Controller PCB pattern (PDF download) [18107101] (Free)
Items relevant to "PICAXE Project Development System":
  • BASIC source code for the PICAXE Project Development System (Software, Free)
Items relevant to "Lab-Standard 16-Bit Digital Potentiometer":
  • Lab-Standard 16-Bit Digital Potentiometer PCB [04107101] (AUD $20.00)
  • PIC16F877A-I/P programmed for the 16-Bit Digital Potentiometer [0410710A.HEX] (Programmed Microcontroller, AUD $20.00)
  • PIC16F877A firmware and source code for the Lab-standard 16-bit Digital Potentiometer [0410710A.HEX] (Software, Free)
  • Lab-Standard 16-bit Digital Potentiometer PCB pattern (PDF download) [04107101] (Free)
  • Lab-Standard 16-bit Digital Potentiometer front panel artwork/drilling template (PDF download) (Free)
Items relevant to "Dual-Tracking ±19V Power Supply, Pt.2":
  • Dual Tracking ±0-19V Power Supply PCB [04206101] (AUD $15.00)
  • Dual Tracking ±0-19V Power Supply front panel PCB [04206102] (AUD $5.00)
  • Dual Tracking ±0-19V Bench Supply PCB patterns (PDF download) [04206101/2/3] (Free)
  • Dual Tracking ±0-19V Supply panel artwork/drilling templates (mains-powered) (PDF download) (Free)
  • Dual Tracking ±0-19V Supply panel artwork/drilling templates (plugpack-powered) (PDF download) (Free)
Articles in this series:
  • Dual-Tracking ±19V Power Supply, Pt.1 (June 2010)
  • Dual-Tracking ±19V Power Supply, Pt.1 (June 2010)
  • Dual-Tracking ±19V Power Supply, Pt.2 (July 2010)
  • Dual-Tracking ±19V Power Supply, Pt.2 (July 2010)

Purchase a printed copy of this issue for $10.00.

By Jeff Monegal PICAXE Project Development System With the abundance of microprocessor/microcontroller variations available these days it is no small wonder that many of the designs produced by electronic enthusiasts use one type or another of these components. And most commercial equipment these days has a micro controlling it. But how do you get from an idea to a working design? W hen designing microcontroller-based circuits, one of the tools available is a project development unit. This allows the software and hardware parts of the design to be tested in a real time environment but without the high cost of designing and building actual prototype systems. Changes to both the software and hardware can easily be implemented without the need to produce a new prototype every time a change is required. 58  Silicon Chip Development systems are available for most microprocessor/microcontroller systems. The development system described here has been squarely aimed at one of the more popular micros available today: the PICAXE range. Very few people involved in the electronics industry – and especially SILICON CHIP readers – would not have heard of the PICAXE. There are now many different versions of the PICAXE, ranging in capabilities from 8-pin chips with limited memory space right up to powerful 40-pin fire-breathers! And this month a brand new PICAXE chip, the 18M2 goes on sale, offering sensational performance and features (see SILICON CHIP June 2010 issue, page 44). The development system described here will allow hardware/software debugging for over 90% of the chips in the PICAXE range. As clever as micros are these days, they all suffer from one problem: siliconchip.com.au Here’s the Oatley Electronics Project Development Board before being populated. You’d normally only have on board the components needed for the particular project, not everything as shown in the photo at left. Note that the white screen-printed overlay is a little misleading, in that links are shown between the prototyping area pads for the ZIF and 14-pin DIL sockets. If you want links, you have to put them in yourself! they will always do exactly what you tell themto do. Unfortunately that is, especially in the early days of development, not exactly what you want it to do. There would not be a programmer in the world who has never needed to debug the software they have written. (Debugging is a term we use to describe the process of developing the software to allow completely problem-free operation ie, getting rid of the “bugs”.) With this system you can assemble the hardware part of the design on a breadboard using the on-board IC sockets and then, using flying wires, connect the other components in the UHF TX (TX01) TX (KUSB2) K277 1 2 3 V+ + 10 F RX MOSFET (2SK3812) 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SOURCE 22k DATA DRAIN EXTERNAL POWER GATE ANT +5V GND IR RX (IRX2) GND USB MODULE V+ -10V +5V +5V SERIAL OUT GND 1 DATA XTAL OR RESONATOR 3 2 +10V SERIAL IN +5 40-PIN ZIF SOCKET 1uF 4 14 12 UHF RX (PVJ6WC) +5V 1uF 7 DATA 1uF 8 + GND + ANTENNA © oatleyelectronics.com + PUSH BUTTON IC1 HIN232 V+ GND 10 11 13 10k 22k PICAXE ANT 9 1uF + GND 433MHz Tx MODULE Vcc DATA RS232 GND 1uF Education allows connection via a USB port on the host PC. Because of this we have included a USB to RS232 converter. This allows much faster program uploading to the PICAXE chip. Note that this article is not meant to be a tutorial on the PICAXE system. More detailed information on the range and capabilities of the various PICAXE chips available is freely available on the internet and from the PICAXE suppliers themselves. Many also offer downloadable software, either saving you the trouble of writing and debugging your code or at least giving you a great springboard for developing your own software. There is a large amount of infor- 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 + design to the chip. Both ZIF (“zero insertion force”) and normal DIL (dual in-line) IC sockets are provided. The big advantage of the ZIF socket is that it can not only handle various sizes (ie, number of pins) of micros but they can be inserted and removed at will; easier than prising them out of DIL sockets. External breadboards can also be used to complement this system when developing larger designs. Once the hardware part of the system has been set up, the software can be downloaded and then system performance can be debugged. The latest version of the free development software from Revolution DATA GND V+ GND Fig.1: the Project Development Board populated with everything possible, as shown in the photo above left. The RS232 interface is top left; alongside it is the 433MHz data transmit module. Centre left is the USB conversion module and immediately below that a power MOSFET. At the bottom are the infrared receiver and the UHF data receive modules. siliconchip.com.au July 2010  59 60  Silicon Chip siliconchip.com.au +5V 1 2 3 4 +5V OUT +5V LINK LINK USB/RS-232C CONVERTER MODULE IN 6 7 8 9 DB9F 10k 22k OUT 22k S 1 F  15 GND PICAXE USB DEVELOPMENT & PROGRAMMING KIT +5V 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +5V +5V +5V 40-PIN ZIF SOCKET +5V +5V 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 +5V +5V 1 2 3 4 5 6 7 8 9 10 11 12 13 14 470nF 28-PIN DIL SOCKET 470nF 28 27 26 25 24 23 22 21 20 19 18 17 16 15 10 F 16V GND 433MHz RX MODULE DATA OUT PVJ6WC 433MHz RX MODULE ANT (173mm WIRE) GND 433MHz TX MODULE ANT (173mm WIRE) TX01 433MHz TX MODULE DATA IN Vcc Fig.2: it’s not so much what is on the PC board as what YOU can put on it for your project development. In its basic form, it has provision for a USB and RS232C interface (which also gives ± supply rails), a power MOSFET, an infrared data receiver module along with both receive and transmit UHF (433MHz) data modules. DATA OUT +5V GND GND GND GND GND GND GND GND GND GND GND GND GND GND GND 1 F IR DATA RX MODULE +5V T2o 7 T1o 14 R2in 8 R1in 13 5 +5V +10V +5V 1 F +5V IRX2 IR DATA RX MODULE 10 T2in 11 T1in 9 R2o 12 R1o IC1 HIN232 4 3 2 1 16 +5V 6 470nF 2SK3812 N-CH MOSFET G 2SK3812 12pF 12pF D –10V 470nF 1 F X1 4MHz RX 2 1 TX GND +5V 3 4 5 470nF PICAXE IN-CIRCUIT SERIAL PROGRAMMING NETWORK DB9M 1 2 3 4 5 10 F 470nF 16V THE MAIN PC BOARD ALSO HAS PROVISION FOR THESE (OPTIONAL) COMPONENTS AND MODULES, BUT THEY ARE NOT PROVIDED IN THE BASIC KIT. THEY CAN BE PURCHASED SEPARATELY FROM THE OATLEY ELECTRONICS WEBSITE: www.oatleyelectronics.com 2010 SC  S1 PUSHBUTTON USB TYPE A PLUG GND EXT POWER mation available on the Revolution Education (UK) web site, www.rev-ed. co.uk/picaxe/. What next? The development board is intended as a platform for PICAXE ideas. With its variety of component pads and connections, it has enormous flexibility. And as we mentioned earlier, if there‘s not enough space on this board, connect it to a protoboard or similar. Looking at this photographs and diagrams of this system we can see that on the left side a variety of on-board support and add-on components has been included. There are specific positions for UHF TX/RX (transmit/receive) modules, along with an infrared receiver, a high current MOSFET and an RS232 interface chip. Some provision is also made for the common components (eg, resistors, capacitors etc) associated with these modules and chips. The RS232 chip is included mainly as a cheap way of producing the positive and negative supply rails used in most opamp circuits. Of course the two inputs/outputs associated with the RS232 chip are also available for use as you require them. The right side of the board is your “playground” – apart from the ZIF socket and 28-pin DIL socket (actually two 14-pin end-to-end) in the centre of the board, the rest is left for your project development. Each of the pins on the ZIF and DIL sockets are brought out to accessible pads, ready for you to wire as required. Of course, if you don’t need to connect to a particular IC pin, you don’t have to. 9 2 SER IN 4 100 IC1 5 PICAXE P2 -08 D G S ON-BOARD MOSFET 3 P4 Vss 22k 8 12V LAMP DIMMER Fig.3: here’s the first project idea, a PICAXE-controlled 12V lamp dimmer using the on-board MOSFET. The photo above shows it in completed form. Here it’s the tiny PICAXE 08 being used. Almost looks lost in the ZIF socket, doesn’t it! 5k POT GND V+ SERIAL IN 14 12 100  RESISTOR SERIAL OUT 1 GND USB MODULE +5V +5V (KUSB2) TX PICAXE 08M + 10 F RX MOSFET (2SK3812) 1 2 3 V+ -10V PUSH BUTTON 3 2 +10V 4 5 6 7 8 GND 1uF 4 V+ 1uF P0 10k 10k 22k PICAXE 10 11 13 7 22k TO PC P3 P1 GND 1uF 8 + 6 7 XTAL OR RESONATOR + VR1 5k 12V LAMP 1 Vdd 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 © oatleyelectronics.com + LAMP BRIGHTNESS UHF TX (TX01) 1uF 1uF + +5V 40-PIN ZIF SOCKET + +12V 9 10 11 12 13 14 15 16 17 18 19 20 K277 SOURCE 22k DRAIN IR RX (IRX2) GATE EXTERNAL POWER GND +5V 12V LAMP siliconchip.com.au +12V +5V V+ GND DATA 0V Fig.4: the completed dimmer PC board. As you can see, there are no UHF or infrared modules fitted, nor RS232 chip, as they are not used in this circuit. July 2010  61 In use +5V Fig.5: project idea 2, a UHF data transmitter. It has a PICAXE 18X and a tiny UHF data transmitter module (the lighter coloured PC board at the top of the photo. Fig.6 (below) similarly TO PC shows the populated PC board. 4 14 RESET +V 10k OUT0 17 18 TRANSMIT 1 S1 15 2 OUT1 IN1 OUT2 IN2 IC1 OUT3 PICAXE18X IN6 16 22k IN0 OUT4 IN7 OUT5 SER.OUT OUT6 3 2 SER.IN OUT7 6 7 8 9 10 11 12 UHF TRANSMITTER 13 0V 5 10k UHF DATA TRANSMITTER ANTENNA WIRE (153mm) UHF TX (TX01) 1uF GND SERIAL OUT 1uF 1 GND USB MODULE +5V (KUSB2) TX 10 1 9 2 4 RX +5V 1 3 PICAXE 18X 5 6 7 8 V+ 18 PUSH BUTTON 3 2 + 10 F GND 4 V+ 1uF SERIAL IN DATA GND 1uF +5 + XTAL OR RESONATOR + 40-PIN ZIF SOCKET © oatleyelectronics.com + V+ 10k 22k PICAXE ANT Vcc DATA 1uF + GND 433MHz Tx MODULE 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 + The PC board is intended to be very flexible. You simply select the features and add-ons required then connect them all together using wires soldered to the pads provided. To start the development of a particular project the operator begins with a circuit diagram. From here, the various connections to and from the chip are made using flying wires. On-board multiple pads are included, which allow various components to be connected to the chip. And as mentioned before, you can always connect more external breadboards if needed. The power supply inputs are wired to the appropriate pins as well as the 2 programming inputs. To connect the PICAXE chip to the host PC, two resistors are necessary. These two resistors are included on-board but must be wired to the correct pins. Some variations of PICAXE chip need an external oscillator and some do not, so a 4MHz crystal is included on-board, just in case. It too must be wired to the correct pins (if in fact required). Finally a reset push button is included. There is no one way that will be best when using this system, so the way components are connected to the micros will vary considerably. The best way we found is to consider this development unit as a breadboard that has a ZIF socket installed. When the hardware side of the project is finished and tested the fun part can commence. That is the software development part of the project. This is where the idea of a software development system comes into its own. 9 10 11 12 13 14 15 16 17 18 19 20 K277 EXTERNAL POWER GND +5V V+ GND INSTALL THIS LINK 10k RESISTOR BETWEEN +5V AND PIN 1 OF PICAXE 62  Silicon Chip +5V 0V siliconchip.com.au Parts List – PICAXE Development Board 1 PC Board, 231 x 77mm, coded K277 1 40-pin ZIF socket 2 14-pin DIL IC sockets 1 DB9 right angle female connector, PCB mounting 1 DB9 solder tail male connector 1 KUSB2 USB-to-serial module 1 USB cable 1 tactile push button switch 1 RS232 Tx/Rx IC (eg, HIN232CP) 1 4MHz crystal +5V 4 RESET Fig.7: project idea 3, a matching UHF data receiver. It also uses a PICAXE 18X and of course the UHF data receiver module is fitted. Fig.8 (below) shows the populated PC board for this TO project. PC +V OUT0 17 UHF RECEIVER 18 1 15 16 2 22k 3 IN0 OUT1 IN1 OUT2 IN2 IN6 Capacitors 1 10F 16V electrolytic 5 1F 16V electrolytic 6 470nF monolithic 2 12pF ceramic 14 IC1 OUT3 PICAXE18X OUT4 IN7 OUT5 SER.OUT OUT6 2 SER.IN OUT7 6 7 Resistors (0.25W 1%) 1 10k 1 22k (required for programming) 8 9 10 11 12 13 1k A 0V 5 10k  LED1 K UHF DATA RECEIVER 1k RESISTOR BETWEEN PIN 13 OF PICAXE AND LED ANODE 3 2 1 GND USB MODULE (KUSB2) +5V TX 18 10 1 9 2 4 RX +5V K277 1 3 PICAXE 18X 5 6 7 8 PUSH BUTTON 4 V+ 1uF + 10 F GND 1uF XTAL OR RESONATOR 1uF SERIAL OUT + 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 9 10 11 12 13 14 15 16 17 18 19 20 DATA ANTENNA WIRE (153mm) +5V GND UHF RX (PVJ6WC) DATA ANT EXTERNAL POWER GND +5V GND IR RX (IRX2) ANTENNA © oatleyelectronics.com SERIAL IN + A V+ 10k 22k PICAXE + K GND 1uF 1uF + LED 40-PIN ZIF SOCKET + Optional items (depending on your application) 1 2SK3812 N channel MOSFET 1 TX01 433MHz transmit module 1 PVJ6WC 433MHz receiver module 1 IRX2 infrared receiver module Short (173mm) lengths of hookup wire for 433MHz antennas Lengths of hookup wire to make connections on board +5V Writing software is fraught with pitfalls. Using this system the performance of software can be analysed in a real-time environment. When changes to remove software bugs or improve performance are siliconchip.com.au V+ GND DATA 0V needed, it becomes a simple matter to make these changes on the PC and then upload them to the PICAXE chip. You do not have to build a new prototype or waste components. The savings in real dollar terms mean the development system pays for itself in a very short time. Some useful examples of software will be available on the Oatley Electronics web site. These examples are not meant to be complete programs July 2010  63 but they can be used to get ideas on how to achieve certain functions using this system. For example, one of the sample programs allows the sending and receiving of multiple bytes of data using a UHF radio link. Another will allow the user to decode the IR signal from a standard TV remote control unit. The PICAXE language allows the signals from an IR signal using the SIRC (Serial Infra-Red Control) protocol to be decoded. This is a popular protocol and chances are that you will have a hand-held remote control that uses it. Other examples of code will allow the on board MOSFET to drive a 12V lamp with full dimming capabilities (PWM). All these examples can be used as is or as a source of tips and ideas for the user. The limit of projects that can be developed using this system is virtually endless. As time goes by, more and more PICAXE code examples will be posted on the Oatley Electronics web site – but search them out on the internet as well. There are many out there and the chances are one of them may do what you want, or is close enough to allow some modification of the code to do so. Project assembly Putting the unit together is simplicity in itself. The component overlay is printed on the PC board and there are not too many components to be soldered in. Just make sure you follow the overlay, particularly where it comes to polarised devices: when they’re put in back to front, the smoke usually gets out and without that all-important smoke, they don’t work real well! Depending on what you want to use your Development Board for, you can leave some components out – for example, if you’re not going to use it for power control, there’s no need to include the MOSFET. Similarly, if you’re not likely to want either infrared data or the UHF (433MHz) data transmitting or receiving, there’s no point in putting these components in. However, there are quite a few minor components which, because of their low cost, can be placed on the PC board “just in case” you ever need them. These include the various resistors, capacitors, even the push-button switch and crystal, etc. Similarly, it’s probably a good idea to place the RS232 chip because it gives you a ±10V power supply – again, just in case you ever need it. Once assembly is complete you should give the unit a good check-over, looking for bad solder joints, missed solder joints, wrongly placed components and any other problems that may have found their way in. And that’s just about it: now all you have to do is design your circuit and write the code to suit. Or, as we said before, find suitable code (eg on the ’net) and modify or cut it as appropriate. Even if you make a mistake, it’s easy to add or remove components on this PC board to do what you want! SC © Oatley Electronics. The kit price of $30.00 includes all items listed in the parts list except those labelled as “optional items”. (Kit cat no K2777) Kits can be ordered via the Oatley Electronics website, www.oatleyelectronics.com.au, or by ’phone on (02) 9584 3563. Sample software code for these three projects can be downloaded from the above website free of charge. Custom Battery Packs, Power Electronics & Chargers For more information, contact Phone (08) 9302 5444 or email mark<at>siomar.com www.batter ybook.com 64  Silicon Chip siliconchip.com.au