Page 25 of 31

Re: TCM8240MD connector and example

Posted: Mon Oct 04, 2010 12:48 am
by Dmitri
noend wrote:
Dmitri wrote:The main issue I found is a bottleneck while writing to the SD card, SPI is configured to work @ 10MHz which is the theoretically the maximum clock speed allowed as per Microchip datasheet.
In my theory, the SPI can work @ 40 MHz quite good. :D

Re: TCM8240MD connector and example

Posted: Mon Oct 04, 2010 7:34 am
by noend
Will give it a try.

Re: TCM8240MD connector and example

Posted: Mon Oct 04, 2010 7:52 am
by Dmitri
noend wrote:
Dmitri wrote:In my theory, the SPI can work @ 40 MHz quite good. :D
I'll then configure it to work @ 40MHz. :D so I suppose the Sandisk MicroSDHC is running at that speed?
Actually, they all may not, but they work indeed. I read that 25 MHz is the limit. It is not ;)
The clock signal looks horrible at a 60MHz oscilloscope.

I use SPI clock speed switching. I found it usefull to run it at lower speeds for FAT operations but at highest speed for miltiblock writes.
BTW, I never test if the block was accepted by reading a reply byte. I could, but I do not. It works quite reliable with many different transflash cards bought on Internet.

The only FAT operation that I need is finding the start sector of a file that I put onto the card before. I start with this sector. Thus, the card is still readable unter Windoze.

Re: TCM8240MD connector and example

Posted: Mon Oct 04, 2010 6:48 pm
by noend
Currently using 10MHz for FAT related operations and 40MHz for multiple block write operations.
Moving actual implementation to use PMP DMA.

Re: TCM8240MD connector and example

Posted: Tue Oct 05, 2010 12:44 am
by Dmitri
Unfortunatelly, there is no PMP DMA with PIC24. As far as I know, there is only a tiny FIFO or so.

Re: TCM8240MD connector and example

Posted: Wed Oct 06, 2010 5:28 am
by noend
Yes, there is.

Re: TCM8240MD connector and example

Posted: Thu Oct 07, 2010 10:41 am
by noend
PMP DMA implemented successfully on PIC24H128GP204.

Re: TCM8240MD connector and example

Posted: Mon Oct 11, 2010 7:06 am
by ollebula
Hi everybody

Very interesting thread this one.
I wonder what the status are of all your projects, anyone got the camera up running at decent speed?
Dmitri seemed to have a half-working system. Anyone else? What about the jpeg compression, anyone taken control of that one?

I would like to interface the camera with a PIC/dsPIC (because I'm used to them) and wonder if there are anyone who would like to share their work with me to get me started.

/Olle

Re: TCM8240MD connector and example

Posted: Wed Oct 13, 2010 2:30 pm
by noend
Finally done! I removed the FIFO successfully and got ~25fps on my design using TCM8230. :D I will send to manufacture a few boards and will post images soon.

Re: TCM8240MD connector and example

Posted: Sat Oct 16, 2010 3:08 am
by Dmitri
noend wrote:Finally done! I removed the FIFO successfully and got ~25fps on my design using TCM8230. :D I will send to manufacture a few boards and will post images soon.
My congratulations!

Re: TCM8240MD connector and example

Posted: Thu Oct 21, 2010 8:52 am
by noend
Dmitri wrote:Unfortunatelly, there is no PMP DMA with PIC24. As far as I know, there is only a tiny FIFO or so.
I'm afraid there is a PMP DMA, at least on the PIC24HJ128GP204. In fact, the old design I had which use the AL422B is using DMA5 with PMP in master mode 2 and a 256 bytes dma buffer. DMA PMP fills a 4800 bytes array which has to be filled 8 times (fill->write to sd) to have a full 160*120 frame.

Re: TCM8240MD connector and example

Posted: Thu Oct 21, 2010 2:49 pm
by Dmitri
noend wrote:
Dmitri wrote:Unfortunatelly, there is no PMP DMA with PIC24. As far as I know, there is only a tiny FIFO or so.
I'm afraid there is a PMP DMA, at least on the PIC24HJ128GP204. In fact, the old design I had which use the AL422B is using DMA5 with PMP in master mode 2 and a 256 bytes dma buffer. DMA PMP fills a 4800 bytes array which has to be filled 8 times (fill->write to sd) to have a full 160*120 frame.
Hmm... Here is the DMA manual for PIC24H

http://ww1.microchip.com/downloads/en/D ... 70223b.pdf

On p.2 I read:
Peripherals supported by the DMA controller include:
• ECAN™ technology
• 10-bit/12-bit Analog-to-Digital Converter (ADC)
• Serial Peripheral Interface (SPI)
• UART
• Input Capture
• Output Compare
I might be missing something :)

Re: TCM8240MD connector and example

Posted: Thu Oct 21, 2010 3:27 pm
by noend
Yes, you are :)

http://ww1.microchip.com/downloads/en/D ... 70302B.pdf

On p.26 I read:
DIRECT MEMORY ACCESS (DMA) SUPPORT
DMA reads from and writes to the PMDIN1 register (DMAxPAD = 0x0608) when the PMP module
is configured for Master mode. To use DMA, follow these steps:
1. The DMAxREQ bits (IRQSEL<6:0>) must be set to ‘b0101101’
2. The PMP module must be configured as a Master (MODE<1:0> = 11 or 10)
3. A PMP interrupt must be generated on every byte (IRQM<1:0> = 01)
As I told you I have my system up and running with PMP DMA.

Re: TCM8240MD connector and example

Posted: Thu Oct 21, 2010 11:35 pm
by Dmitri
noend wrote:Yes, you are :)

http://ww1.microchip.com/downloads/en/D ... 70302B.pdf

On p.26 I read:
DIRECT MEMORY ACCESS (DMA) SUPPORT
DMA reads from and writes to the PMDIN1 register (DMAxPAD = 0x0608) when the PMP module
is configured for Master mode. To use DMA, follow these steps:
1. The DMAxREQ bits (IRQSEL<6:0>) must be set to ‘b0101101’
2. The PMP module must be configured as a Master (MODE<1:0> = 11 or 10)
3. A PMP interrupt must be generated on every byte (IRQM<1:0> = 01)
As I told you I have my system up and running with PMP DMA.
OMG! Microchip has indeed forgot to mention PMP in its DMA manual. OMG!

Good to know. Thank you! :)

Re: TCM8240MD connector and example

Posted: Fri Oct 22, 2010 11:16 pm
by comadrejo
Congratulations Mr Dmitri, you got an impressive compact
design.

It is a shame that I have not found yet in the forum a single
Schematic TRULLY TESTED of how to PARTICULARLY interface
the TCM8230MD cam.

I am not asking the schematic of your FULL design , JUST the
detail of :
+ Critical feed Volts in analog cam pins.
+ Cam pins targeted by Microcontroller pins (and how)

Just that (only CAM CONNECTIONS INVOLVED).

Keep for you deeper details as :
SD connection.
Your particular Micro settings.
Your Micro In System Programming method.
Source code.
...

Many of us want the cam for educational purposes, not to
win the Novel Price.

I just want to connect the cam to my ATMega8 to take just
1 single frame in ALL NECESSARY TIME FOR THE PURPOSE. Just
seeing the 1 single frame in the PC will make me happy.

Many other users would look more ambicious purposes, but
ALL need basic interfacing to start from.

Please, give us that essential PRACTICAL feedback.

Best regards.