Home Price List Order Info P928 PIC Training Course P931 PIC Training Course P942 PIC Training Course

PICs and Power Training Course for Win XP, Vista, Win 7 etc
PICs and Power Training Course
Learn about XLP PICs
and Motor Control
(New October 2012)

17th October 2012
Peter Brunning writes:-

Over the years since I have been working with PICs I have often needed a simple convenient circuit with the ability to switch a high current load to experiment with a few ideas. A year or so ago I decided to create a PCB which would provide for these needs. Then what was to be just a simple circuit, expanded to perform all the tasks which I occasionally need.

So the PICs and Power circuit was created initially for my own needs, and now I have just finished a new book to go with this circuit to provide existing P928/PH28 and P931/P942 users with extra training.

The P&P circuit has provision to fit one PIC which can be an 8, 14, 18, 20, 28 or 40 pin PIC. The circuit is wired with eight high current surface mount MOSFETs, and has sockets for a 16 character by 2 line LCD and a keypad.

The MOSFETs are arranged as P-N pairs with each pair being switched using one bit of port C (28 or 40 pin PIC). Each output of the MOSFETs is taken to its own screw terminal so that there is total flexibility in the output wiring.

The circuits in the book show all the possible ways to connect MOSFETs to a PIC. A simple single P or N channel MOSFET, a complimentary output, and single and double bridge circuits, for driving anything from a simple DC motor or other high current load, to a stepper motor.

The book (chapter 10) gives detailed information on how to select suitable MOSFETs. The MOSFETs we use in the P&P circuit have a maximum on resistance of 0.012 ohms and are rated to switch 20 volts at 12 amps continuouly. We have tested the total circuit and set a conservative overall rating of switching 16 volts at 5 amps continuous.

The P&P circuit plugs onto the 7 pin plug at the front of the P928-X or P931 or P942 programmer. The 5 volt supply is taken from the programmer. The high current supply which the PIC switches via the MOSFETs is plugged into a standard 2.1mm socket centre positive.

The 8 high current MOSFET are arranged as two P+N bridges. Each of these small surface mount MOSFETs has a continuous rating of 12 amps which is only possible due to their very low on resistance of 0.012 ohms maximum. The maximum peak current is rated at 96 amps. The full circuit is conservatively rated to drive up to 16 volts at 5 amps for motors, stepper motors and any other DC load. Each of the MOSFET drain connections is wired through to a screw pressure terminal at the front of the circuit to enable total flexibility in the wiring of motors and stepper motors.


The PAP circuit also has provision to connect a Brunning Software USB to USART adaptor PCB (as shown in this picture). This allows the PIC in the PAP circuit to communicate with your PC so that, for example, a stepper motor can be remotely controlled by your PC.


Experimenting with PICs and Power - using BSPWA

The PICs and Power training course is centred around the book "Experimenting with PICs and Power using BSPWA". This book assumes you already have a basic understanding of PIC programming. If you are a complete beginner the ideal place to start is with our P928-X or P931 training course.

With the PICs and Power course as you have already passed the beginner's stage it is not necessary to type in all the programme text. BSPWA includes a selectable library which is an intigral part of the assembler. We start our study in chapter 2 by selecting the appropriate library text to create a programme to write a string of text to the LCD. We then expand this programme to use the keypad to write numbers to the LCD. The Brunning Software BSPWA PIC assembler includes a simulated LCD and a simulated keypad so we are able to study the action of each instruction by single stepping the code. Once we have the general idea of the process we write the code into a PIC and test the programme in the P&P circuit.

In chapter 3 we learn the importance of the latest XLP 16F PICs by studying the differences between the XLP PICs (PIC16F1827 and PIC16F1936) and the original PICs (PIC16F84, PIC16F627A, and PIC16F88). In chapter 4 we revise the hardware timers, and in chapter 5 the oscillators.

In chapter 6 we change to using the second generation of 18F PICs. (The series before XLP). We flash the LEDs and write to the LCD so that we understand the similarity between 16F and 18F PICs. We finish the chapter by studying the RAM arrangement of 18F PICs ready to expand the ideas when we use the XLP 18F PICs. In chapters 7, 8 and 9 we study the memory requirement of XLP 18F PICs, the timers, interrupts, and the ADC.

In chapter 10 we learn how to wire high current MOSFETs to any PIC old or new so that a high current load such as a motor can be controlled by the PIC. We study single ended N and P MOSFET circuits, complementary outputs, and bridge circuits. We then type in programme text to put the circuits to use. We start with a speed controller for a 16F XLP PIC. We use the PICs comparator to monitor the open circuit emf of the motor so that we can control the speed while maintaining the ability to connect full supply to the motor if the speed drops. We modify the programme text to run in an 18F XLP PIC then we experiment with a motor reversing circuit using a MOSFET bridge circuit.

In chapter 11 we study the control of stepper motors from first principles. We examine the simple 4 MOSFET open drain circuit needed to control 6 lead stepper motors and compare this to the full bridge circuit used with 4 lead stepper motors. We then study the simple programme text needed to create single step movement. We learn that acceleration and deceleration are needed to ensure accurate movement of the stepper motor. The full stepper motor control experimental programme text runs on for 10 pages so we load this from the CD, wire a stepper motor to the P&P circuit, and experiment with various acceleration parameters. For these experiments we use the keypad to enter the control data.

At the end of chapter 11 we study how to use a PC to control the stepper motor. The programme for the PC (note PC not PIC) is written in Visual C#. This is a small part of the book which can only be attempted if you have some previous knowledge of Visual C#. (Note: The Brunning Software PH28-X training course includes training in Visual C#). The Visual C# section is easy to write but should be skipped over if you have never used Visual C#.

In the final chapter of the book we study microstepping from first principles.

This book is wirobound to open flat, 240mm x 170mm, 190 pages.

Click How to order.

PICs and Power Training Course.

Price list
  1. Fully built PICs and Power experimental PCB with 8 power MOSFETs
    + LCD assembly
    + Keypad assembly
    + Book: Experimenting with PICs and Power using BSPWA
    + BSPWA PIC assembler + library code + examples on CD......... £69.00

    or

    Part built PICs and Power experimental PCB with 8 power MOSFETs
          (requires some assembly and soldering)
    + LCD assembly
    + Keypad assembly
    + Book: Experimenting with PICs and Power using BSPWA
    + BSPWA PIC assembler + library code + examples on CD......... £49.00

  2. PIC16F1827 + 16F1936 + 18F2321 + 18F25K22 test PICs............ £ 9.45

  3. Thermistor for temperature experiment & 4.5 volt DC motor............ £ 1.55

  4. USB to USART converter with USB cable.................................... £11.50

  5. UK postage and insurance........................................................... £5.50
    (Europe postage and insurance........ £15.00.    Rest of world........ £24.00)
The part built circuit has the 8 MOSFETs, resistors and some of the sockets already fitted and soldered.
Most of the other sockets and components have been fitted and secured with one terminal soldered.
You will need to fit the remaining components (which are supplied), and you will need to solder
all the unsoldered connections. The PICs and Power circuit is lead free. We suggest that you should
complete the build using lead free solder.

To select the items to buy click goto selection page.

Motors and motor PSU
The PICs and Power PCB takes its 5 volt supply from the programmer socket. This means that usually the 5 volt supply will come from the P928, P931, P942 or P182 programmer but when the USB to USART adaptor PCB is connected this will supply the 5 volt supply. This is fully explained in the Experimenting with PICs and Power book.

For the DC motor experiments you will need a small DC motor and for the stepper motor experiments you will need a four lead 1.8 degree stepper motor. For the motor and stepper motor experiments you will also need a regulated power supply of a suitable voltage to power the motor. This can be between 4.5 volts and 12 volts up to 5 amps with a 2.1 mm centre positive connector. A 1 amp supply will be sufficient for a typical small DC motor and a typical stepper motor used in these experiments. The best way to purchase a stepper motor is to Google search the internet for a 12 volt stepper motor. There are usually low cost stepper motors to be found.


Home Price List Order Info P928 PIC Training Course P931 PIC Training Course P942 PIC Training Course