Search found 6690 matches

by RogerClark
Sat Sep 23, 2017 8:47 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

Yes. Just running the first part of code in Timer_setup() void TIMER_Setup(void) { gpio_set_mode(GPIOA, 1, GPIO_INPUT_FLOATING); timer_pause(TIMER2); // stop timer timer_init(TIMER2); // turn timer RCC on #define TIMER_RELOAD_VALUE 2 // must be adapted according to the results // as this mode is not...
by RogerClark
Sat Sep 23, 2017 8:37 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

I tried using timer_pause(TIMER2); but it didn't help

I had to disable the DMA

(TIMER2->regs).gen->DIER = (0); // disable DMA request on TIM2 update
by RogerClark
Sat Sep 23, 2017 6:56 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

I'm getting closer to a solution. The problem is (TIMER2->regs).gen->DIER = (TIMER_DIER_UDE); // enable DMA request on TIM2 update Seems to be somehow interfering with the SDFat If I disable the DMA on TIM2 update, I am able to save a image to SD. (TIMER2->regs).gen->DIER = (0); // disable DMA reque...
by RogerClark
Sat Sep 23, 2017 5:20 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

Another update. It looks like the Timer setup code in the LiveOV7670 code void TIMER_Setup(void) { gpio_set_mode(GPIOA, 1, GPIO_INPUT_FLOATING); // Slave mode: Reset mode (see RM0008, chap. 15.3.14, page 394) // ------------------------ // The counter and its prescaler can be reinitialized in respon...
by RogerClark
Sat Sep 23, 2017 4:54 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

Steve I've tried to save the LCD display after a frame has been read from the camera, but it fails because it looks like the timer or DMA etc is interfering with the SD SPI access somehow. Here is my code that I'm using to read the display and write to SD #include <SdFat.h> #include "Adafruit_ILI934...
by RogerClark
Sat Sep 23, 2017 3:52 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

Hi Victor Both the camera and the SD are on the same SPI bus (SPI1) I can't use SPI2 because the camera has to be on specific pins i.e PB8 - PB15 as Steve's code does a DMA read from the upper half of port B. (and thats where SPI 2 is located) I'll need to check if SPI2 can be remapped, but I've got...
by RogerClark
Sat Sep 23, 2017 12:13 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

I just double checked the if the readback can have yStart > yEnd but it definitely causes corruption of the data I'm going to go back to reading the LCD line by line, as I don't think its going to save any significant time by reading multiple lines because of the time to swap lines, i.e there would ...
by RogerClark
Fri Sep 22, 2017 10:07 pm
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

By writing 12 lines at a time, I've got the time down to 742 mS I'm still reading the display, line by line, so I can probably shave a few mS off this, but although reading from the LCD can be faster, because the image seems to be upside down, I may still need to flip it vertically in code (in block...
by RogerClark
Fri Sep 22, 2017 8:19 pm
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

Thanks Steve I am already using snippetsnof the BMP code from the Arduno forum, and it seems to work OK. Thanks for the link to the L1 joeg compressor, but for the F1 I am not sure if it has enough RAM. Writing to SD is currently very slow if I only write 1 line at a time. ( over 5 seconds) I should...
by RogerClark
Fri Sep 22, 2017 8:09 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 304
Views: 11614

Re: OV7670, Generic STM32F103RC and ILI9341 display

Just did some speed tests and 1000 calls to readPixels unsigned long m=millis(); for(int i=0;i<1000;i++) { tft.readPixels(0,0,320,0, lineBufLCD); } Serial.println(millis()-m); shows 1284ms So about 1.2ms per line. This was slower than I'd expected and looking in the code for readPixels, I think this...