Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Delay for LCD

Status
Not open for further replies.

MrNobody

New Member
Hi..
I need some help with few delays for LCD.
I am using PIC18F4620 running at 40MHz and am trying to use C18 xlcd library to control LCD.

Inside there I need to create 3 delay functions namely
void DelayFor18TCY(void);
void DelayPORXLCD(void);
void DelayXLCD(void);

For void DelayPORXLCD(void), i can use Delay10KTCYx(15) to generate a delay of 15ms.
And as for DelayXLCD(void); i can use Delay10KTCYx(5) to generate a delay of 5ms.

However, what is the duration of delay for DelayFor18TCY(void).

Please advise.. Thanks..
 
Last edited:
I read the C18 Compiler libraries and it wrote the DelayFor18TCY( void ) as

void DelayFor18TCY( void )
{
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
}

Any reason why it is 12 Nop()s..?
Thanks..
 
I read the C18 Compiler libraries and it wrote the DelayFor18TCY( void ) as

void DelayFor18TCY( void )
{
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
}

Any reason why it is 12 Nop()s..?
Thanks..
Perhaps they're including cycles used for the call or rcall and return instructions?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top