Author Topic: Lyontek LY68L6400 8 megabyte SPI "SRAM" - am I reading the data sheet right?  (Read 6877 times)

0 Members and 1 Guest are viewing this topic.

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
I was thinking on running a DMA ISR to fetch the next task buffer in advance, before execution. But a DMA interrupt every 8us will hurt a lot, so maybe the only way is to load it at the begginning of the task, adding more delay.
This would only make sense if the task is so heavy that the psram time represents a small impact.
But I guess the only logical solution is upgrading the stm32, if staying with the same family (F4), this is usually straightforward, not requiring any modification.
Otherwise you're again in the situation of the ferrari with the brick under the gas pedal and cement sacks in the trunk.

Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
Quote
the only logical solution is upgrading the stm32

Sure, if another 64k is fine.

This way, you can get another 8MB which you won't get on a CPU (of this sort) for any money. And for a lot of projects it would be ok. For example let's say you are capturing data from an ADC and you want a lot of temp storage, for processing and later saving in a FLASH file system. This SPI "SRAM" would do that just fine, for under $3. The writing speed can be megabytes/sec which is pretty respectable.

There is a risk: it is chinese. But there is a number of "copies" which appear to have an identical data sheet.

« Last Edit: May 28, 2022, 06:31:01 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1682
  • Country: nl
A small upgrade to a bigger STM32F4 part is 64K RAM extra.. but is that enough?
The QuadSPI module on those chips are still not able to work with this kind of device. They specifically talk about external FLASH, not RAM, and it is not capable of (automatically) adhering to a refresh cycle, transaction length limit, etc.
The FMC on the bigger F4 parts is able to speak to SDRAM, but those require a few dozen pins to connect.

A upgrade to a newer chip with OCTOSPI would work with a lot less hassle and CPU overhead, but outside STM32F4 and for sure prettty much all peripherals have been 'upgraded' (or for existing applications, changed for sake of change).

Like I said, I'm under the impression you're dev'ing for this system for a long time now, and so I imagine there is not just only 1 board in your lab.. but probably more potentially at customers as well. If I speak from experience from small companies, they will want to ship things out even before a bootloader is completely ready. :palm: Not a great time to swap out the MCU..

I think your best bet is to go for a normal SRAM chip. You can get them up to 512kB size, which is still very decent.
Or live with the fiddly code & very frequent interrupts to adhere to the 8us CE limit.
« Last Edit: May 28, 2022, 08:16:17 am by hans »
 

Online westfw

  • Super Contributor
  • ***
  • Posts: 4290
  • Country: us
Quote
It was more like that with any DRAM I have used before - if you somehow accessed every address in the "row" then the device was refreshed for the whole period (typically 2ms back then, IIRC).
Although, for this to work with multiple banks of DRAM, you had to to do RAS on ALL the banks of chips, but only "output enable" the bank whose data you actually wanted.  Essentially, trading off power consumption for ease of refresh.  If the Serial DRAM wants to trade things off in the other direction, they could have multiple internal "banks" that need special attention during refresh.  (though that seems a bit unlikely, given modern DRAM architectures (?))
Sun-1 CPUs did this, along with other tricks, to get faster-than-typical access speeds out of their paged DRAM...
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
At 21Mbit, at best 2MB/s, and with a lot of overhead and cpu load...
If you're working with small buffers or using the psram as "swap" (Storing the unused memory), that's ok, but if the program loop uses all that, it's 500ms per MB.
The STM32F469 seems to cost few just bucks more, has 384KB SRAM and also quad-spi.
Is the design unmovable at this stage? Sorry, I can't remember the details.
But if you could move some pins so the psram gets the quad, and you're now in 8MB/s.
If you get it to 42MHz.... that's 15MB/s, Plus the 469 is a little faster, 45MHz, so 16MB/s.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
Quote
The FMC on the bigger F4 parts is able to speak to SDRAM, but those require a few dozen pins to connect.

IMHO the 32F4 applications where external memory can be used are quite unusual. You lose most of the GPIO. It takes one back to the Z80 :)

Quote
I'm under the impression you're dev'ing for this system for a long time now, and so I imagine there is not just only 1 board in your lab

It must be 3 years now. Someone was working on it a part of a day per week so obviously very slowly, and about 1.5 years ago I decided it would never be finished at that rate (well, obviously, you might say, but it is my business to run and I was busy elsewhere) so I got back into C big-time and went up a huge learning curve, but I enjoy it. Currently, apart from libs like ETH and USB (all ex ST and buggy as hell originally) I have written the majority of the code. The other guy is clever on stuff like TLS (which I never learnt) so is doing that, and that's now working although it (MbedTLS) eats up ~50k of RAM. I still mostly avoid pointers :) There is a lot of stuff in there. Everything the 32F4 does except CAN and I2C. Can't talk about the function openly unfortunately, yet.

I really do not want to change the CPU now, and fortunately there is no need. Also I have 500+ of the 32F417 in stock, after a very long wait :) If we get a customer who wants TLS and some other RAM-hungry feature then I can go up to the next CPU which should be a minor change; mostly in the AF pin mapping.

This 8Mbyte SPI RAM thing is for peripheral (no pun intended) projects and it would be good to have but is not a core function of the main product. I will be testing it in a few days' time.

Quote
gets the quad, and you're now in 8MB/s.

Any apps I foresee will be fine with 2MByte/sec.
« Last Edit: May 28, 2022, 06:45:54 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
Quite difficult to get this chip to work. It needs specific values (0) on pins 3,7 even though they are not used in normal SPI mode. The data sheet says these "should" be 0 at power-up; I have them tied to VCC. Tying them to GND makes it work, so they are sensing them for some purpose. Having done that, it runs.

Next, is to thrash it with CE=0 a lot longer than 8us, and other tests :)
« Last Edit: June 09, 2022, 08:09:07 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1816
  • Country: au
Quite difficult to get this chip to work. It needs specific values (0) on pins 3,7 even though they are not used in normal SPI mode. The data sheet says these "should" be 0 at power-up; I have them tied to VCC. Tying them to GND makes it work, so they are sensing them for some purpose. Having done that, it runs.

Next, is to thrash it with CE=0 a lot longer than 8us, and other tests :)

You might want to heat it up too :)

This different PSRAM variant, reports an on die temperature sense, that can signal when it can be relaxed on refresh.  (seems just a single bit )
https://www.mouser.com/ProductDetail/AP-Memory/APS12808L-3OBM-BA?qs=IS%252B4QmGtzzrXcGkbuYahqw%3D%3D

It also mentions reduced refresh coverage, but they seem to trade that for lower power, rather than extended refresh gateways.

The high temp data suggests things get 4x worse, going from 85°C to 105°C
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
Stretching the current 7us (I am writing and reading 4 bytes in that, using poorly optimised code) to 107us produces zero errors.

So I filled the 2MB with data (equal to the address, 4 bytes at a time) using the 7us CE=0 timing, and put this delay in before reading it all back

Code: [Select]
spi_ram_cs(0);
osDelay (1000);
spi_ram_cs(1);

and, you have to laugh, 1000ms never produces errors, 3000ms works nearly all the time, 5000ms fails but only after about a megabyte.

So it looks like the refresh margin is absolutely huge, and the 8us is BS except possibly in very specific circumstances like totally solid W/R with just the minimum CS=1 time (50ns) in between.

I am not surprised that this "DRAM" holds data for > 1 second with no refresh. It was known in the 1980s that you can recover data from DRAM (back then the refresh period was 2-4 ms!) after some seconds, from PCs which were switched off, for stuff like forensics, espionage, etc.
« Last Edit: June 09, 2022, 09:39:01 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: PCB.Wiz

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
The specified value is guaranteed at all temperatured and voltages...you never know when extending it.
Just like when the stm32 faster than 168MHZ, will run fine at 240MHz.
Will you take the risk shipping thousands, then getting strabge errors and having to recall them all?


Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
Sure, but the context of this thread isn't so much how far one can stretch a DRAM.

It is the meaning of the data sheet; specifically what that 8us max CS=0 time relates to.

I am now testing with 64 byte packets which totally bust the 8us, but they do have generous gaps between them. This code runs in a loop

Code: [Select]
#define pkt 64
uint32_t buf[pkt/4];
uint32_t buf3[pkt/4];
debug_thread_printf("starting 2MB write");

// fill buffer with funny 32-bit numbers
for (uint32_t i=0;i<(pkt/4);i++)
{
buf3[i]=i*12345;
}

// write it into 2MB of RAM
for (uint32_t addr=0; addr<(1024*1024*2); addr+=pkt )
{
SPI_RAM_write(addr,(uint8_t*)buf3,pkt);
}

debug_thread_printf("finished 2MB write");

//spi_ram_cs(0);
//osDelay (1000);  // this can be up to 2-3 secs before it breaks
//spi_ram_cs(1);

debug_thread_printf("starting 2MB read");

// read it back
for (uint32_t addr=0; addr<(1024*1024*2); addr+=pkt )
{
SPI_RAM_read(addr,(uint8_t*)bufc,pkt);
bool diff=false;
for (uint32_t j=0;j<(pkt/4);j++)
{
if (bufc[j]!=buf3[j]) diff=true;
}
if (diff)
{
debug_thread_printf("failed at addr=%lu",addr);
}

}

debug_thread_printf("finished 2MB read");

At 21MHz SPI clock and 16 byte packets it is reading or writing the 2MB in about 2 seconds, due to lack of optimisation. With larger packets it does the full 2MB/sec.

Runs fine too with 16384 byte packets. Any more, my target runs out of RAM. So clearly one or both of these is happening

- there is enough CS=1 time to enable refresh even though the 8us max CS=0 spec is massively busted
- consecutive accesses of 1024 or 8192 (nobody seems to be sure) locations performs the refresh (like would happen on any DRAM)

Interestingly, with a 5 second CS=0 wait between the fill and the readback, it fails every time and fails at a consistent address: 1073152 decimal, which is 1024x1048.

Finally, it is not clear what the use of the software reset command is, but it doesn't seem to do any harm.

Quote
This different PSRAM variant, reports an on die temperature sense, that can signal when it can be relaxed on refresh.  (seems just a single bit )
https://www.mouser.com/ProductDetail/AP-Memory/APS12808L-3OBM-BA?qs=IS%252B4QmGtzzrXcGkbuYahqw%3D%3D
It also mentions reduced refresh coverage, but they seem to trade that for lower power, rather than extended refresh gateways.

Interesting chip, especially for 3 quid... It still has that weird min CS=0 spec, this time 4us, and they don't explain why. That makes it useless for any long burst operations, of course.

I then moved on to temperature tests and got some interesting results.



With 512 byte packets (CS=0 for 200us) it started to produce errors at +90C.
With 16 byte packets (CS=0 for 11us) I got no errors ever, and I tested it right up to +100C.

The above was without the very long CS=0 period between filling it and reading it out. During this period, the device should not be refreshing at all, and temperature dependent failures are expected:
With 512 byte packets and a 1000ms block on refresh, it started to produce errors at +50C.
With 512 byte packets and a 100ms block on refresh, it started to product errors at +70C.
The above is a totally unrealistic test because nobody will be deliberately blocking refresh by holding CS=0.

CS=1 for about 8us in all cases. That is probably important because clearly the chip starts the internal refresh as soon as it sees CS=1, and with the min CS=1 spec of just 50ns it must be pretty quick about it. It is reasonable to assume that the 50ns gives it time for just one refresh and as above debate shows, that adds up to some kind of normal DRAM refresh rate.

The fact that there is a measurable temperature dependency of the errors between CS=0 for 11us and 200us suggests that while the chip manages to squeeze in the initiation of a refresh in the 50ns CS=1 gap, it doesn't do the refresh cycles all that fast afterwards. I reckon it does them at a rate of about (order of magnitude) 1 every 1us.

Next I tested the hypothesis that reading more than 8192 (or 1024) consecutive locations does a full refresh. A test with a packet size of 8192 (CS=0 for 3ms) produces errors at around +70C. This is slightly worse than the 512-byte packet situation where it starts to fail at +90C. This is with a CS=1 time of around 8us as previously. Increasing the 8us to 100us does not change the +70C temperature, which is also interesting because it suggests that the chip is not grabbing that extra opportunity to squeeze in enough refresh cycles. Or maybe the temperature issue is not refresh related after all?

No matter how you shake it, the 8us number seems extremely conservative. Or maybe they are working on a really high chip temperature, produced by the maximum clock rates of 144MHz at a Tamb of +85C. In my product, running the RAM test all the time, the delta-T of the chip, relative to the PCB, is under 1K (1C).
« Last Edit: June 09, 2022, 08:56:49 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: PCB.Wiz

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
Hah! The APS12808L-3OBM-BA provides 1us tCEM for ext. temp. range.
DDR octo-spi@133MHz will do 266bytes, but that time window is barely usable in simple spi and slower rates.
I guess the mcus will eventually support this natively, reducing the overhead and providing maximum efficiency.
« Last Edit: June 11, 2022, 01:42:20 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1816
  • Country: au
Next I tested the hypothesis that reading more than 8192 (or 1024) consecutive locations does a full refresh. A test with a packet size of 8192 (CS=0 for 3ms) produces errors at around +70C. This is slightly worse than the 512-byte packet situation where it starts to fail at +90C. This is with a CS=1 time of around 8us as previously.
Strange, that suggests you cannot actually get the theoretical equivalent of full refresh, by doing a full chip-wide (8192?) read ?  Maybe it needs other than 8192 ? ( addit: I see #34 mentions 16384 was always ok ? )


Increasing the 8us to 100us does not change the +70C temperature, which is also interesting because it suggests that the chip is not grabbing that extra opportunity to squeeze in enough refresh cycles.
Can you easily check Icc during CS=1 ?
I could never decide if the parts data implied it 
a) ran refresh during CS=1 (that implies a second on chip oscillator and needs the complexity of clock gating, and would have non zero Icc )
or
b) if they used the SCK to do refresh during the preamble of address load. There are quite a few clocks, where nothing happens inside the RAM array.
That means CS=1 time is not gaining anything.
« Last Edit: June 10, 2022, 04:49:47 am by PCB.Wiz »
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
Quote
I guess the mcus will eventually support this natively

As I wrote before, I am damn sure the ESP32 doesn't do more than four bytes at a time.

Quote
Hah! The APS12808L-3OBM-BA provides 1us tCEM for ext. temp. range.

Typically of chinese parts (they probably ripped off the design from somebody else) they still don't explain why this is. Is it to give a more frequent CS=1 interval? I find that hard to believe because it cripples applications which want to transfer a lot of bytes but infrequently.

Quote
DDR octo-spi@133MHz will do 266bytes, but that time window is barely usable unusable in simple spi and slower rates.
I guess the mcus will eventually support this natively

Maybe but it uses up a lot of GPIO pins. And you still get a huge performance hit compared to normal RAM. Basically these chips are ok for a narrow range of applications where you want the 16 MB but don't care about the x10 to x100 slowdown. In most cases the application has to be specially designed to work with this chip even if the SPI is transparent. Same with my LY68L6400; one has to code it in specially, using it for buffering specific data.

Quote
that suggests you cannot actually get the theoretical equivalent of full refresh, by doing a full chip-wide (8192?) read ?  Maybe it needs other than 8192 ? ( addit: I see #34 mentions 16384 was always ok ? )

I can't find the mention of 16384 but I tested it. Like 8192, it still fails at +70C.
I also tested the refresh-by-access hypothesis with

Code: [Select]

spi_ram_cs(0);
osDelay (10000);  // 10 second refresh block
spi_ram_cs(1);

between filling it and reading it all back, and it fails 100% of the time. So quite bizzarely this chip does not refresh by accessing the memory array. I wonder how they achieved that ;) Don't normal DRAM chips do that? They always used to.

16384 is not really usable except to play with; +70C is too low.

IMHO, 512 is a good number. This fails at +90C. This would be OK for "normal" SPI usage where you are

- just using it as a data buffer, not running code out of it, etc
- not using a 100MHz+ SPI clock (I am using 21MHz; the max possible)
- product Tamb spec is not above +65C (+85C, even assuming negligible self heating, is a bit suspect because plastics start to go soft)

Quote
Can you easily check Icc during CS=1 ?
I could never decide if the parts data implied it
a) ran refresh during CS=1 (that implies a second on chip oscillator and needs the complexity of clock gating, and would have non zero Icc )
or
b) if they used the SCK to do refresh during the preamble of address load. There are quite a few clocks, where nothing happens inside the RAM array.
That means CS=1 time is not gaining anything.

I did wonder about Icc spikes during CS=1, to test the refresh hypothesis. Well, they obviously do have an internal oscillator for this, because the chip has to hold data with no SPI activity.

Yes, with the SPI protocol - 4 bytes of overhead, 5 bytes with the faster rates - there is ample time for refresh. So they have much more than the 50ns min CS=1 time.

We are stuck with a data sheet written by monkeys, or written to not reveal who the design is stolen from :)

The two images show the timings with 512 bytes and with 16 bytes. On the latter you can see the 4 byte header overhead. I could optimise the code (there is a lot one can do e.g. set up one's data buffer to have the 4 byte header in front of it, so just one DMA transfer is needed, or do the DMA code inline so the DMA pointers don't need reloading, etc) but for the 512 byte case this is pointless.
« Last Edit: June 10, 2022, 06:22:39 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1816
  • Country: au

I can't find the mention of 16384 but I tested it. Like 8192, it still fails at +70C.
I also tested the refresh-by-access hypothesis with

Code: [Select]

spi_ram_cs(0);
osDelay (10000);  // 10 second refresh block
spi_ram_cs(1);

between filling it and reading it all back, and it fails 100% of the time. So quite bizzarely this chip does not refresh by accessing the memory array. I wonder how they achieved that ;) Don't normal DRAM chips do that? They always used to.

16384 is not really usable except to play with; +70C is too low.
I'm not quite following this test ?
10s confirms it is volatile DRAM, but to test refresh-by-access, you would need to scan the DRAM inside the refresh time ( ISTR seeing 64ms whole chip times somewhere ? )  and squeeze all other times to try to exclude any auto-refresh.
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
Ah yes you are totally right. I would need to fill it up, then keep reading say 16384 locations, with 64ms gaps with CS=0.

But I am sure it will pass that test. It already passes a 16k fill, a 1 second wait with CS=0, and then reading it all back.

I tried to see if holding CS=0 for 64ms at a time, followed by a read of x addresses, for 6.4 seconds, will produce corrupted data

Code: [Select]
for (int i=0;i<100; i++)
{
kde_spi_ram_cs(0);
osDelay (64);
kde_spi_ram_cs(1);
SPI_RAM_read(0,(uint8_t*)bufc,pkt);
}

and it does not. So it appears that the device does get refreshed by reading. But... the problem is that this works fine for all kinds of x values. I would have expected it to fail for x < 1024, or x < 8192, but even x=512 and x=16 work fine. So somehow the device is managing to sneak in enough refreshes. There are no errors even at elevated temperatures.

Now I am trying to identify the device presence, at product startup. Apart from some test data, it looks like the Read ID would be a good way. Counting the bits in fig 12.4, 0 to 103, it looks like 9 bytes are read, including the OD 5D. I am seeing the 0D 5D and the rest looks random except for a CR at the end. This is data from two different devices




So just one byte differs. These came out of a strip of 10, so it looks like a serial number. But it could be some device property, so maybe not unique.
« Last Edit: June 10, 2022, 01:59:33 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online woofy

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: gb
    • Woofys Place
I would guess its a UID, 48 bits is a common length for that, but I would check all 10 devices anyway.

What a wonderful data sheet  |O

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
Some devices have a randomised ID, while some have a very non-random ID which could just be 1 bit away from the next one (but they still guarantee all are unique), while some have a huge number which is incrementing.

I suspect the last one is what this device does.

I am using only the first two bytes, whose values are documented in the data sheet, to detect device presence. There is no point in using the other 7 bytes given that this is an optional feature in the product.

It's actually quite a challenge to use this stuff to form a normal looking serial number. You have to hash it into something which can be printed out on a label and not be too long, and accept it won't be incrementing. I suppose one could use it to form an ETH Mac # ;) ;)

BTW I also found another issue with this "CS=0 maximum" business: in an RTOS environment, it can be easy to stretch the CE=0 time to some large figure if a higher priority task is running, and then you do get data corruption, as one might expect. The longest packet I tested with was 16384 which transfers in about 6ms, and I found that if one goes well beyond that, say 15ms, the data does get corrupted. Not surprising since the data sheet says 8us max :) but still a useful data point.
« Last Edit: June 11, 2022, 08:43:12 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
Check the tkm32f499... 128pin, 240MHz, Cortex-M4, embedding 8MB SDRAM.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1682
  • Country: nl
BTW I also found another issue with this "CS=0 maximum" business: in an RTOS environment, it can be easy to stretch the CE=0 time to some large figure if a higher priority task is running, and then you do get data corruption, as one might expect. The longest packet I tested with was 16384 which transfers in about 6ms, and I found that if one goes well beyond that, say 15ms, the data does get corrupted. Not surprising since the data sheet says 8us max :) but still a useful data point.

If you use DMA SPI, you could use the transfer complete interrupt to clear chip select active.
Otherwise, if you use small bursts of 8us, you maybe block the OS from context switching if this is a low priority task, but that's kind of a messy hack.

But like said, it's not recommended to go beyond the 8us maximum to have proper function over temperature. If you have hot air, I would be interested to hear what happens if you turn it on at 70C , and point it to the PSRAM chip while doing the same test. I bet data corruption would take place with a shorter CS interval.
Maybe I actually do this test -out of curiosity- with the HyperRAM chips I've got. I've got them talking properly over OCTOSPI and can adhere to the 4us limit by hardware, but it's also possible to configure a high amount of refresh cycles and stretch it far beyond 4us.

Maybe you could still stretch CS if you don't need the full temperature range of operation, but IMO it's getting in the sketchy territory where I would use large margins to make sure things a 3-sigma or greater population spread should still work. But it's all second guessing when you don't have hard data on how fast the SDRAM cells discharge for a specific temperature.
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
I did the temp tests - see posts above. I would conclude that there is a continuous spectrum of temperature dependency, from CE=0 being 8us, through longer CE=0 values, and at temps below about +40C there are no failures at any CE=0 period below about 1 second.

One could measure this and plot it.

It also seems obvious that the 8us spec, and slightly bigger values e.g. 20-50us, correspond to a pretty extreme set of conditions (probably assisted by strong chip self-heating) as I wrote above. For example the data sheet gives the max Icc as 40mA which at 3.3V is 132mW and looking at some examples online for thermal resistance chip to PCB (about 70K/W, junction to PCB, for non high power SO-8 devices) this translates to a temp rise of 10C, yet my thermal imaging shows < 1C rise in my application which is a continuous test but at 21MHz instead of 100+ MHz.

The CE=0 lenghtening is easily fixed by disabling the event interrupt which is causing this, during the packet. That is the USB interrupt. I posted about this before. During FLASH FS write it can be 16ms. During a FLASH FS read it is only 200us.

So far I have tested just two chips and the 2nd one I am unable to make fail, by heating with hot air. The tests on the first chip were done by heating its package directly with a soldering iron until it started to fail and then its temperature was read off on the IR imager. Obviously I will do more tests on that chip.
« Last Edit: June 11, 2022, 05:24:51 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
I did a few more temp tests, this time on another chip. Packet size in bytes, failure temp in degC

16384   70
512   70
256   80
128   95
64   115

I didn't go above 115C.

The transfers are DMA, 21MHz. A 512 byte packet has CS=0 for 200us.

Like I said before, the max CS=0 of 8us to be "real" would need some pretty extreme conditions. And at 21MHz, running the test solidly, the top of the chip is the same temp as the PCB, within the resolution of the IR sensor.



The hot bit in the bottom left has a U-BLOX GPS module on the other side of the PCB, drawing a few tens of mA.

« Last Edit: June 15, 2022, 03:51:17 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
Although improvable, you could try contacting them for more info.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5121
  • Country: bt
A decade back I messed with ISSI IS66_something 4Mx16 PSRAM (48pin BGA). I built a xilinx based controller to make an 8bit serial 8MB "octoram" out of it :phew:. We used to use it with arduinos and with the pic32MX as swap file and ramdisk (retrobsd project). It also had 8us CE max, thus it seems to me that it is the same dram core used for your SPI chip as well. It had several control registers, afaik in one of the regs you could set the temperature for temperature compensated refresh (4 temperature profiles). Doublecheck with your chip, perhaps it may help you somehow.
« Last Edit: June 14, 2022, 07:02:08 pm by imo »
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: gb
  • Doing electronics since the 1960s...
The data sheet has nothing (see above) and I would think that any DRAM chip config registers would be inaccessible once the devices are placed behind an SPI or QSPI controller.

Actually it is an interesting Q for these devices which apparently contain two DRAM chips: do the DRAM chips have an SPI+QSPI controller, which is ignored if the DRAM is packaged with a parallel interface (TQFP,BGA etc) for a memory module, but can be activated for packaging in an SO-8? It would also need a provision for connecting multiple DRAM chips together. Otherwise, these SO-8 packages would have to contain three chips: the two DRAMs and the SPI+QSPI controller. And a large number of bonding wires.

Really interesting stuff, but unsurprising since refresh requirements are heavily temp dependent.
« Last Edit: June 15, 2022, 04:13:45 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf