Hello World!
I am learning PIC Interfacing and I stumbled across this codes at the link "https://circuitdigest.com/sites/default/files/MyLCD.h"
From the hex file, i have a few inquiries to ask, can you please help me out?
1. if(data_bit& 1)
May I know what is the meaning for "data_bit&"?
2.
void Lcd_Cmd(char a)
{
RS = 0;
Lcd_SetBit(a); //Incoming Hex value
EN = 1;
__delay_ms(4);
EN = 0;
}
a) What does "char a" do? Based on the ASCII Table, it has a decimal value of 97.
b) Does RS and EN mean any programming or engineering term?
c) What does this code do?
3. if(a== 1)
{
temp = 0x80 + b - 1; //80H is used to move the cursor
z = temp>>4; //Lower 8-bits
y = temp & 0x0F; //Upper 8-bits
}
a) Why is 1 selected to be stored as "a"?
b) where does the formula "0x80 + b - 1" come from? What i know is 0x80 is the most significant bit of an 8-bit byte set.
c) How does "z = temp>>4" make it lover 8-bits?
4. Lcd_Cmd(0x03);
__delay_ms(5);
Lcd_Cmd(0x03);
__delay_ms(11);
a) What does Lcd_Cmd(0x03) do?
b) Are there reasons for 5 and 11 to be chosen as delay or it can be anything?
5. Lcd_Cmd(0x06);
What does this do?
6. Lcd_SetBit(Upper_Nibble>>4); //Send upper half by shifting by 4
What do they mean by send upper half? What I understand is Upper_Nibble divide by 2^4 which will give 15
Question 7 will come later on, else it will make the post extremely long plus I am worn out trying to understand it as well. Any help will be welcomed and thanks for your patience to read such a long forum.
I am learning PIC Interfacing and I stumbled across this codes at the link "https://circuitdigest.com/sites/default/files/MyLCD.h"
From the hex file, i have a few inquiries to ask, can you please help me out?
1. if(data_bit& 1)
May I know what is the meaning for "data_bit&"?
2.
void Lcd_Cmd(char a)
{
RS = 0;
Lcd_SetBit(a); //Incoming Hex value
EN = 1;
__delay_ms(4);
EN = 0;
}
a) What does "char a" do? Based on the ASCII Table, it has a decimal value of 97.
b) Does RS and EN mean any programming or engineering term?
c) What does this code do?
3. if(a== 1)
{
temp = 0x80 + b - 1; //80H is used to move the cursor
z = temp>>4; //Lower 8-bits
y = temp & 0x0F; //Upper 8-bits
}
a) Why is 1 selected to be stored as "a"?
b) where does the formula "0x80 + b - 1" come from? What i know is 0x80 is the most significant bit of an 8-bit byte set.
c) How does "z = temp>>4" make it lover 8-bits?
4. Lcd_Cmd(0x03);
__delay_ms(5);
Lcd_Cmd(0x03);
__delay_ms(11);
a) What does Lcd_Cmd(0x03) do?
b) Are there reasons for 5 and 11 to be chosen as delay or it can be anything?
5. Lcd_Cmd(0x06);
What does this do?
6. Lcd_SetBit(Upper_Nibble>>4); //Send upper half by shifting by 4
What do they mean by send upper half? What I understand is Upper_Nibble divide by 2^4 which will give 15
Question 7 will come later on, else it will make the post extremely long plus I am worn out trying to understand it as well. Any help will be welcomed and thanks for your patience to read such a long forum.