求单片机 步进电机 程序答:假设你是两相步进电机,使用一个专用模块驱动,A,/A,B,/B由P1口低四位控制,以下程序按半步工作 ORG 0000H LJMP START ORG 0060H START:CLR EA MOV SP,#60H LOOP0:MOV R0,#8 LOOP1:MOV DPTR,HSTEPTAB MOV A,R0 MOVC A,@A+DPTR MOV P1,A LCALL DELAY DJNZ R0,LOOP1 SJMP LOOP0 D...
单片机控制步进电机要求:有加速、减速、停止、正转、反转按钮,电机是四...答:我用的是控制一个步进电机的,这个是我以前写的,你的要求在下面的程序做修改就行了;程序如下:include <reg52.h> define uchar unsigned char define uint unsigned int //uchar table[]={0x18,0x30,0x60,0x48,0x48,0x60,0x30,0x18}; //二相励磁 uchar table[]={0x08,0x10,0x20,0x...
用C51单片机,编写脉冲控制步进电机的驱动器答:Time0() interrupt 1//T0中断服务(显示扫描、步进驱动){ static uchar pot[4] = {0x01,0x02,0x04,0x08};//LED位置输出数据 static uchar i = 0;//扫描位置 static uchar rht[8] = {0x01,0x03,0x02,0x06,//步进电机节拍表 0x04,0x0c,0x08,0x09};static uchar rhi = 0;//节拍...