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

 
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.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…