Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Fastest external memory for PIC18F?

Status
Not open for further replies.

Alloy

Advanced Member level 4
Joined
Apr 3, 2016
Messages
116
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,003
Hey
How fast can be SPI or I2C RAM for PIC18F?
I would like to read data in blocks, will 10us be enough for such read? Maybe 20us?
Any ideas?
 

My PIC runs at 32MHz. How much us would it take to read a block? What block size?
 

Hello!

My PIC runs at 32MHz. How much us would it take to read a block? What block size?

It depends on the SPI flash and also how you program your µP.
If you use a 80 MHz flash in SPI, then you can read 10 MBytes per second (in regular SPI).
As many chips have blocks of 256 bytes (some are 264), then you can calculate
how many µs you need to transmit 256 bytes at 10M/s.

Now your processor runs at 32MHz, therefore the max SPI rate will be 16. Therefore you will
be at 2MBytes / second only.

Next problem: If you program like this:

Code:
uint16 i;
uint8 buf[BUF_LEN];

for(i = 0 ; i < BLOCK_LEN ; ++i) {
    buf[i] = read_byte();
}

then you will never be even close to 10 MBytes/second because the loop takes time.
If the loop eats, say, 10 cycles, then you have to add 0.3µs per byte because the
read_byte function will wait for completion.

What you have to do is using the DMA (if you have one).

That's about it.

Dora.
 

The fastest speed you can get to transfer a block of data using a PIC18F in SPI mode, is the clock speed divided by 4 then divided by 9 (using DMA mode) so 32Mhz is 0.88MB/s so a 512 bytes block will take 576uS
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top