Hi everyone, im currently working on stepper motor, im using UCN5804 as my
stepper motor driver, then i connect PIC 16f877A as my indexer to run the motor. i have wrote a C program for PIC which im not sure correct or no, im really new
with C. Here is the coding i wrote for PIC, and i attach the stepper motor datasheet, UCN5804B datasheet, and the schematic as well. please help me out.
Stepper motor im using is PX243-01AA.
Here the RB0 is connected to Direction Pin of UCN5804B and RB1 is connected to Step input pin of UCN5804B.
#include <htc.h>
#include "delay.h"
__CONFIG(0x3f71);
void main (void)
{
unsigned char i;
TRISB = 0x00;
RB0 = 1;
for (i=0; i<60; ++i)
{
RB1 = 1;
DelayUs(1000);
RB1 = 0;
DelayUs(1000);
}
}
stepper motor driver, then i connect PIC 16f877A as my indexer to run the motor. i have wrote a C program for PIC which im not sure correct or no, im really new
with C. Here is the coding i wrote for PIC, and i attach the stepper motor datasheet, UCN5804B datasheet, and the schematic as well. please help me out.
Stepper motor im using is PX243-01AA.
Here the RB0 is connected to Direction Pin of UCN5804B and RB1 is connected to Step input pin of UCN5804B.
#include <htc.h>
#include "delay.h"
__CONFIG(0x3f71);
void main (void)
{
unsigned char i;
TRISB = 0x00;
RB0 = 1;
for (i=0; i<60; ++i)
{
RB1 = 1;
DelayUs(1000);
RB1 = 0;
DelayUs(1000);
}
}
Attachments
-
155.2 KB Views: 27
-
615.5 KB Views: 33
-
25 KB Views: 49