| Home | Price List | Order Info | Microcontrollers | Assembler | C and C++ |
| 18F PICs and Stepper Motors |
|
(If you are a newcomer to PIC microcontrollers (or you are new to this web site) you may find the information on this page rather confusing. You need to begin by studying using our P927 PIC training and development system so if you are a beginner click here to read about our P927). Which PIC is best to select for a new design? In 1999 when I wrote my first book about PICs the PIC16F84 was the only PIC which had flash memory which was the main reason I chose it to be the focus of that book. Now 8 years later the PIC16F84A is not a good PIC to use for new designs which raises the question of which PIC is the best. All PICs with 'C' in the middle of their number are obsolete, and many of the 'F' PICs although being modern technology are not suitable for new designs. For simple projects the 18 pin PIC16F627A is ideal. For simple projects needing an analogue to digital converter use the PIC16F88. For projects needing an analogue to digital converter and a USART it is best to use a 28 pin PIC. The PIC16F870 is a good choice in some situations but the PIC18F2321 (PIC18F4321 family) offers better value. For larger projects needing a moderate amount of memory if you are familiar with 16F PICs use the PIC16F876A (28 pins) or PIC16F877A (40 pins), but a better option is to use the 28 pin PIC18F2420 or PIC18F2520, or 40 pin PIC18F4420 or PIC18F4520. The PIC18F242, PIC18F252, PIC18F442 and PIC18F452 should not be used for new designs. For projects requiring huge amounts of memory use the 28 pin PIC18F2525 or PIC18F2620, or the 40 pin PIC18F4525 or PIC18F4620. The best place to begin is our P927 PIC training and development system. The first book of our P927 introduces PIC programming from the ground up using the PIC16F627A, PIC16F88, PIC16F870 and PIC18F2321. The second book takes you deeper into PIC programming using the C language. Now for the next stage of your learning we go back to PIC assembly language to introduce the fundamentals of the latest 18F range of PICs. You will need to own or update to our P927 PIC training system before taking this step. |
![]() |
18F PICs are extremely well designed. They have the ability to control very complicated applications but they also have the ability to be used in a very simple manner. Focusing on the simplicity is where the Brunning Software teaching systems excel. But if we are to learn about a new microcontroller we first need to envisage an interesting use for the system. Hence, 18F PICs and stepper motors. Two rather complex subjects bought together in a way which is exciting and easy to understand for everyone who is interested in electronics. |
|
Whether you ultimately have a use for stepper motors is not important. The subject is fascinating. We start by programming a PIC18F2321 to flash LEDs, the idea being to demonstrate how easy it is to programme 18F PICs. Then we study some of the programming techniques that we will need. We experiment with the built in timer using first 8 bits and then 16 bits. We write messages to the LCD and learn about the use of 18F memory. We create a real time clock, experiment with the various oscillator modes, use the watchdog and the sleep mode. We experiment with the analogue to digital converter, experiment with serial data, and experiment with speed control of DC motors using first the comparator then the ADC. Then chapter 12 introduces the AUX145-SM stepper motor controller. We use it to write to the LCD, to experiment with the keypad, and to communicate with our PC via the AUX145-SM RS-232 serial port. In the last experiment in this chapter we use our PC keyboard to write text via the AUX145 module to the LCD on the programmer module. Chapter 14 is where we learn about stepper motors. We find that to get the rotor moving quickly we need to use a logarithmic system of acceleration. We use our PC to send the acceleration data, the maximum speed data, and the number of steps. Then by pressing one of four keys on our PC we can single step forwards or backwards, or rotate one full acceleration/deceleration sequence forwards or backwards. |
![]() |
For programming and experimental work the AUX145-SM stepper motor controller plugs into the 40 pin ZIF socket of our P801 programmer module. The AUX145-SM module has an onboard 28 pin PIC which can be a 16F or 18F, and it has its own RS-232 interface which allows the stepper motors to be controlled directly from your PC. Two or more stepper motors can be controlled by daisy chaining AUX145-SM modules together. |
|
The pictures show our set up for experimenting with 3 stepper motors. The main AUX145-SM module is plugged into the programmer module which allows it to be easily reprogrammed and allows it to write messages to the LCD on the programmer. This is very useful in the early stages of learning about stepper motors. The AUX145-SM modules may look rather simple circuits but what you do not see in these pictures is the eight high current MOSFETs mounted on the track side of the PCBs. In the experiment shown here each stepper motor has its own AUX145-SM controller. This is the simplest arrangement but if we use a split power supply each module can drive two stepper motors. |
![]() |
The eight MOSFETs on the underside of the board have very low saturation resistance with just 5V gate voltage making the circuit suitable for driving stepper motors from 5 to 20 volts at continuous currents up to 1A, and transient currents up to 18A. These MOSFETs are huge chips in tiny packages. When the module is plugged into the 40 pin ZIF it takes its supply from the programmer. The main module has its own 5V regulator so once the system is programmed and set up it can be operated without being connected to the programmer module. The secondary modules take their supply from the main module and link to the PC via the main module. |
|
If you already own our P927 PIC Training System..... Price list.....
|
Optional Power Supply To operate the stepper motor you will need a 5 volt 1 amp power supply with a standard 2.1mm DC connector (centre positive). We can supply a 5V 2A plugtop PSU with a UK plug.....£ 10.00 Postage when supplied at same time as main order..... UK by courier........... included UK by Royal mail.... £: 2.50 Europe..................... £ 4.50 Rest.......................... £ 6.00 We can only supply this PSU with a UK plug |
|
Update price list P701 or P801 to P927..... Order code U927.....
If you purchased your PIC training system before January 2006 you will also need to solder a 15pF capacitor between two pins of the 40 pin ZIF socket. Full instructions are included. |
Optional Power Supply To operate the stepper motor you will need a 5 volt 1 amp power supply with a standard 2.1mm DC connector (centre positive). We can supply a 5V 2A plugtop PSU with a UK plug.....£ 10.00 Postage when supplied at same time as U901..... UK by courier........... included UK by Royal mail.... £: 2.50 Europe..................... £ 4.50 Rest.......................... £ 6.00 We can only supply this PSU with a UK plug |
PICs Programmed To avoid possible confusion the 18F assembler, simulator and programming software is a separate programme (BSPH). It has data built in for the following PICs, and these can all be programmed with this software using the Brunning Software P927 PIC programmer.
|
| Home | Price List | Order Info | Microcontrollers | Assembler | C and C++ |