Search found 6692 matches

by RogerClark
Sat Sep 23, 2017 10:49 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 307
Views: 11652

Re: OV7670, Generic STM32F103RC and ILI9341 display

Hi Steve I don't understand why, but calling dma_disable(DMA1, DMA_CH2); dma_clear_isr_bits(DMA1, DMA_CH2); before using the SD lib didnt help. I still get the same problem and the SD card gets corrupted, I get a file on the SD, but the size is 0 and the name is some non- ASCII characters I definite...
by RogerClark
Sat Sep 23, 2017 9:03 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 307
Views: 11652

Re: OV7670, Generic STM32F103RC and ILI9341 display

OK

I'll try that

BTW.
Currently after writing to SD, just re-enabling the Timer DMA enable does not start the camera running again, but if I have to completely re-init the timer and DMA etc that would be OK, as saving to SD is not a a quick process as it takes around 700mS
by RogerClark
Sat Sep 23, 2017 8:47 am
Forum: Projects
Topic: OV7670, Generic STM32F103RC and ILI9341 display
Replies: 307
Views: 11652

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: 307
Views: 11652

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: 307
Views: 11652

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: 307
Views: 11652

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: 307
Views: 11652

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: 307
Views: 11652

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: 307
Views: 11652

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: 307
Views: 11652

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...