KurtE
Senior Member+
I wonder if there are any hints on this on how they use SDRAM with CSI in the 1050 document
True, I have not really studied the LCDIF as I don't think we have had any boards that have enough pins exported to use. I might take a lookThey're using LCDIF (and PXP) to output to the display... which is pretty tricky considering the amount of pins shared between CSI and LCDIF
Thanks, @mjs513 (and others), I updated again the dogbone... excel document all of the LCD pins on the right hand side of the@KurtE the dev board has all the eCLDIF pins exposed. Starting from B0_00 to B1_13 I believe.
Sorry, I did not go all the way up on the SS to those pins... I have now...Need to update B0_00 through B0_03 accordingly
Exactly.But still, not with the current board due to the missing CSI data pins.
Merged:Pushed up current version to fork of defragsters github project and issued PR
#include "RA8876_t3.h"
#include "SDRAM_t4.h"
#include "Teensy41_Cardlike.h"
#include "flexio_teensy_mm.c"
/*
// MicroMod
uint8_t dc = 13;
uint8_t cs = 11;
uint8_t rst = 5;
*/
// SDRAM Board
uint8_t dc = 17;
uint8_t cs = 14;
uint8_t rst = 27;
/*
// T4.1
uint8_t dc = 13;
uint8_t cs = 11;
uint8_t rst = 12;
*/
uint32_t start = 0;
uint32_t end = 0;
uint8_t busSpeed = 20;
RA8876_t3 lcd = RA8876_t3(dc,cs,rst); //(dc, cs, rst)
SDRAM_t4 fb_sdram;
static uint16_t* frameBuffer;
static uint16_t* frameBuffer1;
void setup() {
while (!Serial && millis() < 3000) {} //wait for Serial Monitor
Serial.printf("%c SDRAM Dev Board and RA8876 parallel 8080 mode testing (8/16)\n\n",12);
// Serial.print(CrashReport);
// pinMode(WINT, INPUT); // For XnWAIT signal if connected and used.
if(!fb_sdram.begin()) {
Serial.printf("SDRAM Init Failed!!!\n");
while(1);
};
frameBuffer = (uint16_t*)sdram_malloc(sizeof(flexio_teensy_mm));
memcpy((uint16_t *)frameBuffer, flexio_teensy_mm, sizeof(flexio_teensy_mm));
frameBuffer1 = (uint16_t*)sdram_malloc(sizeof(teensy41_Cardlike));
memcpy((uint16_t *)frameBuffer1, teensy41_Cardlike, sizeof(teensy41_Cardlike));
if(!lcd.begin(busSpeed)) Serial.printf("lcd.begin(busSpeed) FAILED!!!\n");
delay(100);
Serial.print("Bus speed: ");
Serial.print(busSpeed,DEC);
Serial.println(" MHZ");
Serial.print("Bus Width: ");
Serial.print(BUS_WIDTH,DEC);
Serial.println("-bits");
}
void loop() {
start = micros();
// lcd.pushPixels16bitDMA(teensy41_Cardlike,1,1,575,424); // FLASHMEM buffer
// lcd.pushPixels16bitDMA(flexio_teensy_mm,530,260,480,320); // FLASHMEM buffer
lcd.pushPixels16bitDMA(frameBuffer,530,260,480,320); // SDRAM buffer
lcd.pushPixels16bitDMA(frameBuffer1,1,1,575,424); // SDRAM buffer
end = micros() - start;
Serial.printf("Wrote %d bytes in %dus\n\n",(575*424)+(480*320), end);
waitforInput();
}
void waitforInput()
{
Serial.println("Press anykey to continue");
while (Serial.read() == -1) ;
while (Serial.read() != -1) ;
}
I had not thought of that. What's interesting is it works fine from flash memory on the MicroMod and T41. So maybe there is a conflict somewhere. I could speed up the bus rate and see if that changes any thing...Looks like flash is just barely too slow to keep up... unless there's code somewhere running directly from flash causing contention?
FLash TEST
full sized decode in 28350 us
half sized decode in 21260 us
quarter sized decode in 7320 us
eighth sized decode in 6104 us
SDRAM TEST
56010
full sized decode in 28208 us
half sized decode in 21061 us
quarter sized decode in 7124 us
eighth sized decode in 5861 us
//
// Perf Test
//
#include <JPEGDEC.h>
#include "../test_images/tulips.h" // 640x480 56k byte test image
JPEGDEC jpeg;
//uint8_t frameBufferSDRAM = (uint8_t *)((((uint32_t)(sdram_malloc(640 * 480 + 32)) + 32) & 0xffffffe0));
uint8_t* frameBufferSDRAM = (uint8_t*)sdram_malloc(640 * 480 * sizeof(uint8_t));
int JPEGDraw(JPEGDRAW *pDraw)
{
// do nothing
return 1; // continue decode
} /* JPEGDraw() */
void setup() {
Serial.begin(115200);
delay(100); // allow time for Serial to start
} /* setup() */
void loop() {
long lTime;
Serial.println("FLash TEST");
if (jpeg.openFLASH((uint8_t *)tulips, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,0)) { // full sized decode
lTime = micros() - lTime;
Serial.printf("full sized decode in %d us\n", (int)lTime);
}
jpeg.close();
}
if (jpeg.openFLASH((uint8_t *)tulips, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_HALF)) { // 1/2 sized decode
lTime = micros() - lTime;
Serial.printf("half sized decode in %d us\n", (int)lTime);
}
jpeg.close();
}
if (jpeg.openFLASH((uint8_t *)tulips, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_QUARTER)) { // 1/4 sized decode
lTime = micros() - lTime;
Serial.printf("quarter sized decode in %d us\n", (int)lTime);
}
jpeg.close();
}
if (jpeg.openFLASH((uint8_t *)tulips, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_EIGHTH)) { // 1/8 sized decode
lTime = micros() - lTime;
Serial.printf("eighth sized decode in %d us\n", (int)lTime);
}
jpeg.close();
}
Serial.println("SDRAM TEST");
Serial.println(sizeof(tulips));
memcpy(frameBufferSDRAM, tulips, sizeof(tulips));
if (jpeg.openRAM((uint8_t *)frameBufferSDRAM, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,0)) { // full sized decode
lTime = micros() - lTime;
Serial.printf("full sized decode in %d us\n", (int)lTime);
} else {
Serial.println("Failed to open Framebuffer!!");
}
jpeg.close();
}
if (jpeg.openRAM((uint8_t *)frameBufferSDRAM, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_HALF)) { // 1/2 sized decode
lTime = micros() - lTime;
Serial.printf("half sized decode in %d us\n", (int)lTime);
} else {
Serial.println("Failed to open Framebuffer!!");
}
jpeg.close();
}
if (jpeg.openRAM((uint8_t *)frameBufferSDRAM, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_QUARTER)) { // 1/4 sized decode
lTime = micros() - lTime;
Serial.printf("quarter sized decode in %d us\n", (int)lTime);
} else {
Serial.println("Failed to open Framebuffer!!");
}
jpeg.close();
}
if (jpeg.openRAM((uint8_t *)frameBufferSDRAM, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_EIGHTH)) { // 1/8 sized decode
lTime = micros() - lTime;
Serial.printf("eighth sized decode in %d us\n", (int)lTime);
} else {
Serial.println("Failed to open Framebuffer!!");
}
jpeg.close();
}
delay(5000);
} /* loop() */
I think which new pins could/should be added to support has been shown now in a few threads including:@KurtE I’ll add all the pins you want. As that will help the community. So go ahead and together with @mjs513 or anyone else, compile a table of the missing pins.
Ideally you’d make a complete table of ALL pins, maybe some of the ones exposed now should be removed. That would be the most structured and correct way of doing it.
I Hid most of the columns, which shows:
The ones in Yellow are the ones we do not have. 3 are critical for CSI (D3-D5)
The PIXLK/MCLK - There are currently other pins on the board that can work, that is pins 59-62 (B1_12 - B1_25) are alternatives to the pins we
use on the T4.1...
Question, what do you mean by complete? That is I have not seen what I would consider a complete one for DB4 or DB4.5. That is oneAs some of you know I made a 4.5 (facelift) that adds USB-PD (USB Power Delivery up to 12V). And it also has SDCARD.
Those are the only changes made (moved the boot button position as well), hence the word facelift.
The USB Host port has sort of two modes:
* USB-PD, you supply your own external power via screw terminal connector.
* USB 5V, the from the input USB-C port is also present on the USB-C Host port.
Simply bridge two of the 2 pads to choose between the two.
Here are both images, if you want to make it look even nicer in the spreadsheet.
As soon as someone presents a complete spreadsheet for a gen5 board, I will make that happen!
I'm hoping that a few pins that are currently present can be removed, to give more space under that tight BGA.
I agree - would be nice to a +5v on the side headers instead of all the 3.3v and gnd pins. Probably could reduce that number.are currently just extra GND and +3.3v... But the only thing missing is +5v, which I may want to provide to the TFT displays...
Not sure if this would help or, not, but I tried to create a IO pin MUX page for the Dogbone document with I think most ofQuestion, what do you mean by complete? That is I have not seen what I would consider a complete one for DB4 or DB4.5. That is one
that shows all of the signals for EMC and now SDIO. Is that what you are wanting?
Merged - can be seen for comment ascreate a IO pin MUX page for the Dogbone document
LCD Memory Transfer test starting!Compiled May 2 2024 at 14:27:09
Bus transfer speed 12.0MHz
fillRect operation takes 0.608 milliseconds to fill the image area.
Put-picture from PROGMEM to display took 3.698ms to begin the operation.
But the next LCD operation was delayed by 0.282ms because data transfer was still underway
16-bit copy from PROGMEM to display took 1063.589ms to begin the transfer (data is on its way while you read this.)
Chromakey copy from PROGMEM to display took 6.432ms to run to completion.
ROP 15 BTE copy took 62.000us, followed by 780.000us internal processing in the RAiO chip.
ROP 0 BTE copy took 62.000us, followed by 783.000us internal processing in the RAiO chip.
ROP 1 BTE copy took 62.000us, followed by 2069.000us internal processing in the RAiO chip.
ROP 2 BTE copy took 62.000us, followed by 2169.000us internal processing in the RAiO chip.
ROP 3 BTE copy took 62.000us, followed by 1294.000us internal processing in the RAiO chip.
ROP 4 BTE copy took 62.000us, followed by 2179.000us internal processing in the RAiO chip.
ROP 5 BTE copy took 62.000us, followed by 1126.000us internal processing in the RAiO chip.
ROP 6 BTE copy took 62.000us, followed by 2013.000us internal processing in the RAiO chip.
ROP 7 BTE copy took 62.000us, followed by 1762.000us internal processing in the RAiO chip.
ROP 8 BTE copy took 62.000us, followed by 2167.000us internal processing in the RAiO chip.
ROP 9 BTE copy took 62.000us, followed by 2183.000us internal processing in the RAiO chip.
ROP 10 BTE copy took 62.000us, followed by 1120.000us internal processing in the RAiO chip.
ROP 11 BTE copy took 62.000us, followed by 2178.000us internal processing in the RAiO chip.
ROP 12 BTE copy took 62.000us, followed by 1344.000us internal processing in the RAiO chip.
ROP 13 BTE copy took 62.000us, followed by 2163.000us internal processing in the RAiO chip.
ROP 14 BTE copy took 62.000us, followed by 2033.000us internal processing in the RAiO chip.
First Page Finished, PRESS ANY KEY...
p->SHIFTBUFHWS[0] = *(uint32_t *)value;
uint32_t *value32 = (uint32_t *)value;
value32++;
p->SHIFTBUFHWS[1] = *(uint32_t *)value32;
value32++;
p->SHIFTBUFHWS[2] = *(uint32_t *)value32;