I set it to 1 and skipped 133 as I figured there was no point in testing it - we know it worksOdd though it should have a line for 133 MHz if the downloaded sketch LINE#1 wasn't changed from: #define FIRST_SPEED 0
I set it to 1 and skipped 133 as I figured there was no point in testing it - we know it worksOdd though it should have a line for 133 MHz if the downloaded sketch LINE#1 wasn't changed from: #define FIRST_SPEED 0
// configure SDRAM parameters
SEMC_BR0 = 0x80000000 | SEMC_BR_MS(13 /*13 = 32 Mbyte*/) | SEMC_BR_VLD;
SEMC_SDRAMCR0 = SEMC_SDRAMCR0_CL(3) |
SEMC_SDRAMCR0_COL(3) | // 3 = 9 bit column
SEMC_SDRAMCR0_BL(3) | // 3 = 8 word burst length
SEMC_SDRAMCR0_PS; // use 16 bit data
SEMC_SDRAMCR1 =
SEMC_SDRAMCR1_ACT2PRE((ns_to_clocks(42, freq)-1)) | // tRAS: ACTIVE to PRECHARGE
SEMC_SDRAMCR1_CKEOFF((ns_to_clocks(42, freq)-1)) | // self refresh
SEMC_SDRAMCR1_WRC((ns_to_clocks(12, freq)-1)) | // tWR: WRITE recovery
SEMC_SDRAMCR1_RFRC((ns_to_clocks(67, freq)-1)) | // tRFC or tXSR: REFRESH recovery
SEMC_SDRAMCR1_ACT2RW((ns_to_clocks(18, freq)-1)) | // tRCD: ACTIVE to READ/WRITE
SEMC_SDRAMCR1_PRE2ACT((ns_to_clocks(18, freq)-1)); // tRP: PRECHARGE to ACTIVE/REFRESH
SEMC_SDRAMCR2 = 0; // TODO... page 1425
SEMC_SDRAMCR3 = 0; // TODO...page 1426
SEMC_SDRAMCR2 =
SEMC_SDRAMCR2_SRRC((ns_to_clocks(67, freq) - 1)) |
SEMC_SDRAMCR2_REF2REF(ns_to_clocks(60, freq)) | /* No Minus one to keep with RM */
SEMC_SDRAMCR2_ACT2ACT(ns_to_clocks(60, freq)) | /* No Minus one to keep with RM */
SEMC_SDRAMCR2_ITO(0); //sdk has: idle = config->tIdleTimeout_Ns / config->tPrescalePeriod_Ns
Very good - except for the shock it caused here - That was put in so we know that we know it works.I set it to 1 and skipped 133 as I figured there was no point in testing it - we know it works
Test summary: 57 tests with 5 ReReads at F_CPU_ACTUAL 600 Mhz: | |||
MHz | Seconds | Read Err | % Err |
133 | 160 | 0 | 0 |
166 | 145 | 0 | 0 |
196 | 136 | 0 | 0 |
206 | 133 | 0 | 0 |
216 | 132 | 0 | 0 |
227 | 128 | 0 | 0 |
240 | 127 | 0 | 0 |
254 | 124 | 937,185 | 0.0392 |
270 | 122 | 1,388,401,790 | 58.0738 |
Those values use SEMC clock ticks as units, they don't care about the CPU's clock.As for the problems at MCU F_CPU over 600 MHz - perhaps it is these likely these ns_to_clocks() timing based values not adjusting for enhanced F_CPU_ACTUAL clock rates so recovery times are being violated ?
I have not seen the problem of using the 8MBtye SDRam on the GIGA for the camera to read into.not sure what issue is with SDRAM - did try the approach earlier the way GIGA uses SDRAM and no good, tried with making the entire region MEM_NOCACHE and again made it worse.
Okay, Thanks. Something else then ... MCU cycling faster and leaving the SDRAM behind it seems ...Those values use SEMC clock ticks as units, they don't care about the CPU's clock.
Im sure you’re already doing this - but you are flushing cache?not sure what issue is with SDRAM - did try the approach earlier the way GIGA uses SDRAM and no good, tried with making the entire region MEM_NOCACHE and again made it worse.
Maybe a strange interaction between DMA and SDRAM.
yepIm sure you’re already doing this - but you are flushing cache?
Maybe try do a data integrity test with SDRAM/DMA? Copy data from one buffer to another and see if they are identical ?
DMAMEM uint16_t array1[(320) * 240] __attribute__((aligned(32)));
EXTMEM uint16_t array2[(320) * 240] __attribute__((aligned(32)));
int errorCnt = 0;
int arraySize = (320 * 240);
void setup() {
Serial.begin(115200);
while (!Serial && millis() < 4000)
;
if (CrashReport) {
Serial.print(CrashReport);
Serial.print("Any Key to continue ...");
delay(50);
while (1) {
if ( Serial.available() ) break;
asm ("wfi");
}
while ( Serial.available() ) {
Serial.print((char)Serial.read());
}
}
Serial.println("Memory comparison test");
Serial.println("Initializing Array1");
for(int i = 0; i < arraySize; i++) {
array1[i] = random(255);
}
Serial.println("Copy Array 1 to Array2");
for(int i = 0; i < arraySize; i++) {
array2[i] = array1[i];
}
Serial.println("comparing Arrays");
for(int i = 0; i < arraySize; i++) {
if(array2[i] != array1[i]) errorCnt = errorCnt + 1;
}
Serial.printf("DMA to SDRAM Error Count for %d array comparison: %d\n", arraySize, errorCnt);
}
void loop() {
}
Memory comparison test
Initializing Array1
Copy Array 1 to Array2
comparing Arrays
DMA to SDRAM Error Count for 76800 array comparison: 0
I will try to get back to trying it on this board. Sort of a PIA at times to hook up all of the wires in a secure enough way. So I much easier playing using the other boards.Assuming the camera stuff is uslng FlexIO and DMA to move from shifter registers to RAM... are the shifters signalling any errors, to indicate overruns (new data being placed without the old data being read first) ?
Sorry been distracted today for a bunch of reasons. Reran the tests but added the time to copy the arrayAnd with a DMA transfer?
DMAMEM to EXTMEM: 0 errors, 1010 microseconds to copy
DMAMEM to DMAMEM: 0 errors, 319 microseconds to copy
RAMMEM to RAMMEM: 0 errors, 68 microseconds to copy
RAMMEM to RAMMEM: 0 errors, 257 microseconds to copy
RAMMEM to EXTMEM: 0 errors, 470 microseconds to copy
EXTMEM to DMAMEM: 0 errors, 1294 microseconds to copy
SDRAM clock time to transfer (micros)
133 1513
166 1294
198 1149
206 1272
216 1272
anything above this fails (I have no cap on the board)
I made quick note somewhere on past pages with initial speed results showing longer at faster - but not seen with current test.Interesting that 198mhz is the minimum.Code:SDRAM clock time to transfer (micros) 133 1513 166 1294 198 1149 206 1272 216 1272 anything above this fails (I have no cap on the board)
Not sure, but most of their carrier boards, have something like:What I'm wondering is why would Sparkfun connect the pin that way (on the micromod) in the first place though? Since it can't be used as a regular IO pin if it's hardwired to a constant voltage... nor can it be used in analog mode to monitor VIN (i.e. a battery level monitor) since AREF = VIN.
Wouldn't that be too large for VIN though? The ATP schematic says "VIN Range 2.2-6.0V".For me the pin had issues if I wanted to use it, as for example for boards with servos, I may want to pass in lipo 3s and /3 is not large enough to get that below 3.3v
In the case of the ATP, I believe that this is due to the Voltage Regulator they choose for the board. AP7361C states:Wouldn't that be too large for VIN though? The ATP schematic says "VIN Range 2.2-6.0V".
Looks to me like a simple voltage divider circuit.The resistor combination you are seeing on that pin is what we in the hardware world call a "digital active termination".