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.

Defining port bits in mikroc

Status
Not open for further replies.

swapan

Full Member level 4
Full Member level 4
Joined
Feb 20, 2009
Messages
204
Helped
27
Reputation
54
Reaction score
24
Trophy points
1,298
Location
Kolkata
Visit site
Activity points
2,839
Hi friends,

In assembly language, particular bit of a I/O port could be defined as '#define Relay - PORTA,1'. In mikroC, how this bit could be defined so that in the code, if the respective bit of the port requires to be set, it could be done as 'Relay = 1' or otherwise.


regards


swapan
 

TRISA = 0; //set all pins on port A as output
TRISA = 1; //set all pins on port A as input

TRISA.F1 = 1; //set pin 1 as input;
TRISA.B1 = 1; //set pin 1 as input;

PORTA.F3 = 1; //Set 1 for bit 3
PORTA.B3 = 1; //Set 1 for bit 3

RA0_bit = 1; //Set 1 for bit 0;
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top