User manual

F1 LV Evaluation Platform User’s Guide
DS41614A-page 20 2011 Microchip Technology Inc.
2.8.3 Add-on Motor Expansion
A main task of the demo code is to allow the user to connect any of the expansion
add-on motor boards and have the PIC16LF1947 determine the motor type and adjust
the drive accordingly. The code provided with the F1 LV Evaluation board works with
the following add-on boards:
- BLDC (DM164130-2)
- BDC (DM164130-6)
- Unipolar Stepper (DM164130-7)
- Bipolar Stepper (DM164130-8)
2.8.4 LCD Display
The time, temperature, pot position and motor speed are displayed on the LCD. The
LCD is a display with multipurpose icons. The display uses 4 commons and 28
segment drives. The Timer1 oscillator is used to clock the display peripheral and allow
the LCD to display data even in Sleep. Normally, the Timer1 counter would be used to
drive the display, but this timer is required for the BLDC software. This requires
configuring the LCD peripheral for a Type B waveform for this demo. The Type B
waveform requires coordinating LCD updates when the peripheral is ready. The BLDC
Interrupt requirements preclude using the built-in LCD interrupt for update
coordination, therefore, the LCD interrupt is polled as part of the main loop. Type A
waveforms can update the display without the extra coordination complexity. The
different waveform types are described in section 21.9 of the PIC16LF1947 data sheet
(DS41414). Because the LCD is clocked from the 32.768 kHz crystal, the LCDIF
operates at a multiple of the crystal frequency, providing a very accurate time base for
the real-time clock.
2.8.5 User Interface
Due to the extreme simplicity of this board, only a single button and a single pot are
available for user input. A MCLR button is also present for the demonstration, this will
function as a master clear switch. These two elements allow the user to cycle through
the display elements, change the motor speed and change the time.
Pressing and releasing the button cycles through the following display modes:
1. Add-on Motor Indicator
2. Setable AM/PM Clock
3. 24-hr clock with seconds
4. Temperature (C)
5. Temperature (F)
6. POT ADC Value
7. Motor RPM (BLDC and stepper motors only)
By holding down the RD2 button during the Setable Clock mode, the minutes will begin
to increment. The minutes will increment from 0-9; when the minutes increment past 9,
the minutes will begin to increase by factors of 10. When incrementing reaches an hour,
the hours will begin to increment and the minutes will stay at 00. The AM/PM indicator
will automatically change accordingly. To set the clock, first set the hours and release
the button. Then, set the tens of minutes and release the button. Finally, set the
seconds. To synchronize the seconds, increment the minutes one final time at the
instant the time reference advances to the next minute.
Turning the pot will change the motor speed.
When an expansion board is present, the F1 LV Evaluation code will automatically
detect the add-on type and modify the motor drive accordingly.