Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Using dsPIC3of control step motor

Status
Not open for further replies.

xuanlienbk

Newbie level 3
Newbie level 3
Joined
Nov 30, 2013
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Hanoi, Vietnam, Vietnam
Activity points
17
Now,I have to do homework.That's Using dsPIC30f4011 control step motor.I just learn about dsPIC so don't understand about it.Can you help me?
 

Please take it as your reference.^^
 

Attachments

  • dspic30f4011.zip
    83.8 KB · Views: 140
These can be replaced


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
if (LATD == 0b0001) LATD = 0b0010;
    else if (LATD == 0b0010) LATD = 0b0100;
    else if (LATD == 0b0100) LATD = 0b1000;
    else if (LATD == 0b1000) LATD = 0b0001;
    else LATD = 0b0001;
 
 
 
if (LATD == 0b0001) LATD = 0b1000;
    else if (LATD == 0b0010) LATD = 0b0001;
    else if (LATD == 0b0100) LATD = 0b0010;
    else if (LATD == 0b1000) LATD = 0b0100;
    else LATD = 0b0001;



by these


Code C - [expand]
1
2
3
4
5
6
7
if(LATD == 0x08)LATD = 0x01 
else LATD <<= 1;
 
 
 
if(LATD == 0x01)LATD = 0x08 
else LATD >>= 1;



//or


Code C - [expand]
1
2
3
4
5
6
7
if((LATD & 0x0F) == 0x08)LATD = LATD & 0xF1 
else LATD <<= 1;
 
 
 
if((LATD & 0x0F) == 0x01)LATD = LATD & 0xF8
else LATD >>= 1;

 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top