Tutorial 07 - DC Motor Demo (Free)
When program run, the DC motor will turn in clockwise and anti clockwise direction with speed up and speed down sequence. This tutorial will work with the Hi-Tech C compilers.
PWM (Pulse-width modulation) Operations:
- PWM Period = [(PR2) + 1] x 4 x Tosc x (TMR2 Prescale Value)
- Pulse Width = (CCPRxL:CCPxCON) x Tosc x (TMR2 Prescale Value)
- Duty Cycle Ratio = (CCPRxL:CCPxCON)/4(PR2 + 1)
- Tosc = 1 / Fosc
iBoard connection:
- RC2(CCP1): L293D Module (E2)
- RC4: L293D Module (I3)
- RC5: L293D Module (I4)
Video:
- Tutorial 7 - DC Motor Demo: Video
Download:
- Tutorial 7 - DC Motor Demo: Source Code; Schematic
- L293D Datasheet: Link
- PIC16F722 DataSheet
- MPLAB IDE 8.40 (93.7MB)
- Hi-Tech C Setup Guide
- Hi-Tech C User Guide
FEATURED PRODUCT