marcos.placona
Senior Member
Hi, I'm working with some LCD displays and so far everything works. I'm just a bit puzzled because I can't really understand how part of the code works, although it works fine
This is the part I don't really understand:
I don't really understand what "pins" does here, and what are they used for. Also, I don't know why it uses "&" in one line, and on the other "*". I understand that the "|" is used as OR qualified, but still don't really know why they are there.
Then there's the values: %11110000, which I believe have something to do with DB4-DB7 (pure guess) and the pins they are connected.
I have DB4-DB7 connected respectively with output 4 - 7. To save my i2c scl pin, I tried to move DB4 from output 4 to output 0, thus changing the value %11110000 to %11100001 . It really messed up the results on the screen.
I know it'd working, and I should be happy with that, but I realy wanna understand more about what I'm doing. So far I was able to understand everything the code does apart from that.
If anybody can give me a light in here, that'd be highly appreciated.
This is the part I don't really understand:
Code:
SendDataByte:
{
pins = byte & %11110000 | rsbit ; Put MSB out first
PULSOUT E,1 ; Give a 10uS pulse on E
pins = byte * %00010000 | rsbit ; Put LSB out second
PULSOUT E,1 ; Give a 10uS pulse on E
rsbit = RSDATmask ; Send to Data register next
RETURN
}
Then there's the values: %11110000, which I believe have something to do with DB4-DB7 (pure guess) and the pins they are connected.
I have DB4-DB7 connected respectively with output 4 - 7. To save my i2c scl pin, I tried to move DB4 from output 4 to output 0, thus changing the value %11110000 to %11100001 . It really messed up the results on the screen.
I know it'd working, and I should be happy with that, but I realy wanna understand more about what I'm doing. So far I was able to understand everything the code does apart from that.
If anybody can give me a light in here, that'd be highly appreciated.