Store the font data in program memory instead.
Store the font data in program memory instead.
I'm using 24C256 for a good reason - due to amount of data being used
Also, when using program memory, it won't be that easy to form the letters, as I do in the example above.
Would 1K of EEPROM be enough for what you're doing?But since in most PICs, on-chip eeprom is limited to 128 or 256 bytes
If so, switch to a pic18, like an 18F26K22. It'll be MUCH faster than trying to read from an I2C EEPROM.
24C256 is 32KB EEPROM.
So I'm using it, because I need that much amount of font/graphics data![]()
In that case, if you're looking for speed then an I2C EEPROM isn't the best of choices.
I have no idea how slow the bit-banged I2CREAD is (probably pretty slow).
A 24C256 isn't all that slow, but you're going to be limited to about 400KHz using the pic's MSSP hardware.
That means a random read operation works out to something like 120us/byte @ 400KHz.
A faster choice would be an SPI EEPROM like a 25LC512. There you'll probably be able to get the MSSP to run at 8MHz,
which would speed up the random read to about 5-10us/byte.
If you can read more than 1 byte at a time then the operations are a bit faster, but Henrik's suggestion of using program memory would be faster.
9x2x8 lcd "command delays" per text line is probably the worst delay
your snippet lacks that exact detail
the st7920 chip has a spi i/f that's a little faster and uses less pins too
there are better methods, at least use a graphics row buffer
even unpacking a "DA" packed font from flash is fasted than bit banged i2c by a large margin
this example uses 16 byte row data transfers for either i/f [way more efficient]
http://www.picbasic.co.uk/forum/showthread.php?t=24218
post# 26/27
Warning I'm not a teacher
Thanks everyone.
So let's answer step by step.
There are no significant delays with ST7920 itself nor SPI should be used for it. I'm looking for best compatibility, and with LCDOUT it works like charm. When reading data from built-in eeprom of PIC16F886, I can update whole, 144x32 pixels screen at 20 fps. That's fully enough.
Regarding the SPI flash, I tried to use 25xx series, but was not able to connect to it via PBP. And by the way, as I know, there is no direct support for hardware MSSP in PBP, so it will be slow as I2C, or I have to use some large inserts on ASM or whatsoever, which will be again limitation in available hardware, like need for PIC18 series, while my code above can be used even on 16F628A.
Maybe I should use some old style, parallel eeprom, like ones used in old motherboards?
Bookmarks