So what should I write instead of 160?
I've searched this forum, and people do use plain numbers in I2C eeprom write/read?
So what should I write instead of 160?
I've searched this forum, and people do use plain numbers in I2C eeprom write/read?
Address var byte
Address = 160
Warning I'm not a teacher
Yeah, you really should spend some time getting that logic analyzer working and understand what it does. It's NOT an oscilloscope and although newer versions of the software does allow it to continously stream and display that's not really its intended purpose.
Anyway, here's what I'd try (and I'd have the logic analyzer hooked up)And I'd like to thank Richard for the primers on PBP I2C the last couple of days, much appreciated!Code:Chip_Address VAR BYTE Mem_Address VAR WORD sda VAR portb.1 scl VAR portb.0 Chip_Address = 160 ' The chip address must be a BYTE, this is the 160 + whatever A0-A2 is set to. ' The memory address must be a WORD for the 24C256, this is the address of the byte to written (or read) ' The data to be written is, in this case, a BYTE but it does not have to be, you can write words or arrays - which are obviously just multiple bytes... FOR Mem_Address = 0 to 12 ' I/O I/O BYTE WORD BYTE I2CWrite sda, scl, Chip_Address, Mem_Address, [Mem_Address.LOWBYTE] NEXT
WOW! Finally it works!
That's very good, this means now I can do a lot of LCD things!Code:x var word y var byte adr var byte sda var portc.0 scl var portc.1 lcdout $fe, $01, " " adr=160 for X=0 to 5 I2CWrite sda, scl, adr, x, [x.lowbyte] lcdout $fe, $14, dec x pause 100 next pause 500 lcdout $fe, $1, "Complete:" lcdout $fe, $c0, " " pause 500 for x=0 to 5 i2cread sda, scl, adr, x, [y] lcdout $fe, $14, dec y pause 100 next stop
Thanks everyone!
by the way, I tried to write 160 directly, instead of adr - also works.
Now I need bitwise hex editor - one that allows editing hex file by bits, not by bytes. Any ideas![]()
Not directly and the following isn't a hex editor but if it's intended purpose is to create "content" for LCDs then https://www.mikroe.com/glcd-font-creator might be what you're looking for.
Here's another one https://www.buydisplay.com/lcd-font-maker and another https://kapusta.cc/2020/03/20/fontedit/
I've not used any of them, I know Richard is using the one from MikroE.
Yes I know all these
The issue with Mikroe "creation" is it, as everything else done by them, is written with left feet- need admin priviledges to run it, and it outputs fonts rotated by 90 degrees
But currently I don't need font editor or graphics editor, I already have all that done, just need some hex editor to put everything into single file and adjust bits as necessary.
Oh and another issue, which deserves separate topic is how to emulate LCDOUT statement, because it can't send $FE to display![]()
Bookmarks