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.

lcd functions in Mplabx

Status
Not open for further replies.

beauty world

Newbie level 5
Joined
Jun 22, 2015
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hi friends.I see that in all of program with LCD In mplabx c8 compiler,3 function delay use.
Code:
void DelayFor18TCY(void){
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();
    return;}

void DelayPORXLCD(void){           //15ms delay
    Delay1KTCYx(30);
}

void DelayXLCD(void){            //5ms delay
__delay_ms(5);
}[CODE]
[/CODE]

i have 2 questions:
1.why we use 3 function delay with each other?
2.and if every NOP()give 1 cycle delay why we use 14 NOP() for 18 cycle delay?
 

Dear beauty world

question number 1 : In the code provided the delays has got nothing to do with each other.
question number 2 : You will notice that the sub routine is called " DelayFor18TCY ". A " Call " instruction is 2 clock cycles and a " Return " is 2 instruction cycles which gives 18 clock cycles.

DevED

Hi friends.I see that in all of program with LCD In mplabx c8 compiler,3 function delay use.
Code:
void DelayFor18TCY(void){
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();
    return;}

void DelayPORXLCD(void){           //15ms delay
    Delay1KTCYx(30);
}

void DelayXLCD(void){            //5ms delay
__delay_ms(5);
}[CODE]
[/CODE]

i have 2 questions:
1.why we use 3 function delay with each other?
2.and if every NOP()give 1 cycle delay why we use 14 NOP() for 18 cycle delay?
 
sorry I didn't catch ur answer about number 1.can u explain more?can we use just one of them in program or we should wirte all delay functions?
andTnx for ur answering.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top