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.

Found this code online...

Status
Not open for further replies.

Neyolight

Full Member level 5
Joined
Aug 29, 2011
Messages
306
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
World
Activity points
3,624
Hi ALL

Ok so i found this bit of code online:

//#include <p18f4450.h>
#include <p18cxxx.h>
//#pragma config WDT = OFF, LVP = OFF, FOSC = INTOSC_HS //internal oscillator

#pragma config WDT=OFF,LVP=OFF,FOSC=HSPLL_HS,PLLDIV=5,CPUDIV=OSC2_PLL3 //run with external oscillator

void main (void);
void InterruptHandlerLow (void);

#define LCD_DATA PORTD ------> I DONT GET WHAT THESE 4 lines are doing? And How they are doing what they are doing?
#define LCD_EN PORTCbits.RC2
#define LCD_RW PORTCbits.RC1
#define LCD_RS PORTCbits.RC0

#define A PORTAbits.RA0
#define B PORTAbits.RA1
#define C PORTAbits.RA2
#define D PORTAbits.RA3




thanks
 

#define LCD_DATA PORTD .
After writing this line you can access PORTD as LCD_DATA. Means using LCD_DATA in your code is same as using PORTD.

Now
PORTD=0x00;
and
LCD_DATA=0x00; are same.
 
Thanks :)

I posted this question and within an hour I reliased what it was :)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top