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.

How to access Port Pin in C.

Status
Not open for further replies.

tectona

Member level 2
Joined
Mar 24, 2006
Messages
53
Helped
4
Reputation
8
Reaction score
0
Trophy points
1,286
Activity points
1,602
portpin code in c

Hi ,all

I use MSP430F449 Controller & IAR C compiler.

I want to access IO port as bit operator.
i.g
P4OUT.0 (access Pin- 0 of Port 4)
P4OUT.1 (access Pin - 1 of Port 4)

What is good way to do this in IAR?

Regards
Tectona
 

sorrry i dont use IAR but all other C compiler like this:

PORTB.1=0; //Pin1 now 0 o off.i think you must try PORT4.0=1.

i suppose that the information you want in compiler's manual
 

_BV(a) = 1<<a;
#define sbi(port,a) port=port|_BV(a)
#define cbi(port,a) port=port&~_BV(a)

sbi for setting a bit in a port and cbi for clearing a bit in a port

bibin John
www.booksbybibin.tk
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top