1 out of 1 members found this post helpful.
Did you find this post helpful?

|
Re: My "Library" for ST7920 Graphical displays, works fine, but...
using I2C, but use PIC running at say 32mhz (instead of current 8mhz), will this result 4x times faster reading speed or not?
If you're running at 8MHz then no wonder everything is slow.
32MHz (or 64MHz for something like an 18F26K22) would definitely be faster, way faster.
The I2C won't necessarily be a lot faster on its own (that depends on how I2CREAD is written), but you can almost bet that it will be.
One thing is for sure, everything else will be much faster.
Getting the pic I2C to run at much more than 400KHz depends on the chip and your hdw.
I2CREAD probably won't do it even running at 32MHz, but the MSSP can if you have pullups with a low enough value.
You won't get 1MHz out of it, but it's possible to get about 800KHz or so given the right setup.
The SPI on a pic tops out at about 8-10MHz, but the selection of available clocks depends on the chip.
I've been able to get 16MHz on a few select 18F devices but that's about the max that the IO pins can do.
There are a lot of benefits to switching to a more modern chip, esp a PIC18F.
I usually like to use a K22, K40, or Q10 for general stuff.
The more recent the chip the cheaper it will be (but I don't buy 2nd hand chips from china).
Measure what, I2C clock frequency?
That's where I always start. That'll let you know the max performance you're getting, and rules out a bunch of other stuff that can mask it.
A few poorly placed delay calls can ruin everything, no matter what speed you're running at.
For example, that SPI code has a totally unnecessary delay call in the read portion that does absolutely nothing but slow down the program (I think it was a 25us delay???).
Last edited by tumbleweed; - 18th May 2022 at 12:04.
Bookmarks