How to program L298N using PIC 16f877

atferrari

Joined Jan 6, 2004
4,764
Yes, you may easily. Read the datasheet and see what settings you need at reset.

Then, check what pins need to change from high to low (or vicerversa) for every desired output.

The one to program is the micro not the L298.

JUst in case I forgot, read the datsheet. Have you?
 

Thread Starter

cpleng7

Joined Dec 18, 2008
120
ya i have go trough the datasheet, but the problem is I don't know how to program PWM inside the motor driver? can you teach me some technique?
 

Nanophotonics

Joined Apr 2, 2009
383
You're PIC will generate the required PWM pulses to your motor driver. Read the PWM section of the PIC data sheet and figure out the duty cycle you want to achieve. In your driver data sheet, you'll find how to interface the PIC with the L298. I suspect you might need to isolate your PIC from your motor driver because of a much higher current flow in the driver.
 

symqwerty

Joined Feb 22, 2010
31
Let's try a simple test. You dont have to think about PWM yet. Just assert 5V to the enable pin and test if your motor driver can work. This is the simple way to use L298N.

The PWM signal driven out by your PIC to the motor driver (enable) pin. PIC16f877 have a built-in pwm. You need to read about CCP module, which letter 'P' belongs to PWM. There are a lot of thread discuss about PWM issue..You can search for it.
 
Top