Can I use a PICAXE for PWM control of a motor?The PICAXE M2 and X2 have a dedicated command which acts on one up to four pins for full PWM control. The M2 and X2 also have a command that allows control of up to 8 servos.
In this tutorial I am going to explain about the pin out, working and control systems of character lcd's. Character lcd's comes in many sizes for example 8x1, 8x2, 8x4, 16x1, 16x2, 20x1, 20x2, 20x4, 24x1, 24x2, 24x4, 32x1, 32x2, 40x1, 40x2 and 40x4. In these MxN dimensions, M represents number of coulombs & N represents number of rows.
The servo command uses the internal timer and internal interrupts so that the pulses are maintained 'in the background' all the time that the PICAXE is running the main program.The command produces a pulse of length 0.01ms to 2.55ms approximately every 20ms. Therefore it can also be used as a simple background PWM output with PWM mark:space ratios between 1:2000 and 1:8 (approx).
What baud rates are supported by serial commands?The PICAXE M2 supports 600, 1200, 2400 and 4800 baud rates when operating at its default 4MHz operating speed. The PICAXE X2 supports 1200, 2400, 4800 and 9600 baud rates at its default 8MHz operating speed.The baud rates will correspondingly double with every doubling of operating speed. For example, 4800 baud at 4MHz will become 9600 baud at 8MHz and 76800 baud at 64MHz.Both M2 and X2 parts support higher baud rates and a wider range of baud rates via the high-speed serial interface using the command. I need more outputs - what can I do?One simple solution is to use a larger PICAXE. The PICAXE 08M2 has 5 I/O lines, the 40X2 has 32.An alternative is to connect one PICAXE to another and use the first to control the outputs of the other.
The second PICAXE, in this example a 20M2, can be programmed with the simple program:let dirsb = $FFmain: serin C.0, N2400, b1let pinsb = b1goto mainThe eight Port B outputs of the second chip can now be controlled with a command by the first chip, where b2 contains the 'pinsb' value (0 to 255) desired on the second chip. Connecting C.7 output from the first PICAXE to the C.0 input of the second gives an additional 8 usable outputs. I need more inputs - what can I do?In the same way an additional PICAXE can be added to provide more outputs, another PICAXE can be added to provide additional inputs. In this example one PICAXE-20M2 reads its C.0-C.7 inputs and sends them out on pin B.7. A second PICAXE reads that signal on C.0 and puts them on its output pins B.0-B.7.; Input reading PICAXEmain: b1 = pinsCserout B.7, N2400, (b1)pause 10goto main; Displaying PICAXElet dirsb = $FFmain: serin C.0, N2400, b1let pinsb = b1goto main. Can the PICAXE handle RF communications?The PICAXE 14M2, 20M2, 28X2 and 40X2 all support and commands which allow for direct interfacing to 'dumb' RF modules such as the transmitter and receiver pair.The PICAXE 08M2 and 18M2 do not support or but can use the NKM2401 to interface to RF receiver and transmitter modules, as can any PICAXE.A PICAXE can interface to 'dumb' RF modules using and commands but we recommend the above solutions as easier, less difficult to make work and giving more reliable operation.