|
Forum Index : Microcontroller and PC projects : MMX 64 camera connections
| Author | Message | ||||
| astro1 Regular Member Joined: 26/06/2016 Location: AustraliaPosts: 53 |
Can someone confirm the camera connections for a MMX64. The names of the control pins in the PDF are not quite the same as the MMX144. OV7670 camera on MMX-64 1=3V3 2=(SIOC)Pin6 3=(VSYNC)Pin12 4=(PCLK)Pin17 5=(D7)Pin3 6=(D5)Pin1 7=(D3)Pin63 8=(D1)Pin61 9=3V3 10=GND 11=(SIOD)Pin5 12=(HREF)Pin11 13=(XCLK)Pin16 14=(D6)Pin2 15=(D4)Pin64 16=(D2)Pin62 17=(D0)Pin58 18=GND Current status on; Camera open Camera capture Pause 15000 Camera close Error: Timeout on camera PCLK signal Thanks. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572 |
Connections are correct - see this post If the open command is working then SIOD, SIOC and XCLK are all OK. HREF, VSYCNC and PCLK are all inputs to the MMX. If you have a scope you should see them all pulsing at different frequencies VSYNCH - once per frame HREF - once per line PCLK - once per pixel The code checks for all of these before taking the picture. The error message says that the MMX isn't seeing the PCLK signal from the camera. |
||||
| astro1 Regular Member Joined: 26/06/2016 Location: AustraliaPosts: 53 |
Hi matherp, Beep test ok to cpu and scope showing showing signals, after camera open. VSync=2Hz HSync=1.35KHz PClk=2.27MHz Xclk=9Mhz Doing a read of the pins shows the changing values. mm.ver=5.0308 |
||||
| plover Guru Joined: 18/04/2013 Location: AustraliaPosts: 306 |
Can your scope take pictures? Wondering if you have modern DSO able to do so. If not your phone camera perhaps show what you see on the scope. the two MHz signals the most interesting. Also a picture of your setup would be very useful. |
||||
| astro1 Regular Member Joined: 26/06/2016 Location: AustraliaPosts: 53 |
The camera works ok on the MMX144, wanted to use it on my MMX64. Signals all come from the camera, after open. Setup picy. |
||||
| plover Guru Joined: 18/04/2013 Location: AustraliaPosts: 306 |
What are the black and green alligator gribs doing? Supplying power? and do I see your keyboard just under or nearby. If it is power supply it may pay to run the +/- cable alongside each other, like the red/black in the middle of the photo. You could also look with your Scope and see what sort of noise you actually have on the power supply depends on how good your scope is whether it is worth the effort. Matherp says Can we see a picture of your scope signal for this? |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572 |
I'll try and set up a test environment and make sure the code hasn't got corrupted somehow. Suggest you don't waste more time until I report back. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572 |
Please try this version and let me know results, I've tweaked some timings and it definitely works for me - thanks 2018-09-16_191632_MMX645.04.18.zip |
||||
| astro1 Regular Member Joined: 26/06/2016 Location: AustraliaPosts: 53 |
Hey look at that, works like a bought one. :') Many thanks. |
||||
| Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 398 |
Setup: -Micromite eXtreme 64 pin with MMBasic Ver 5.05.01 @ 200MHz -OV7670 camera (w/o FIFO) -ILI9341 (SPI type) display -SD card (attached to the display) -All soldered to a board with wire connections and the PIC on 64 pin adapter. The camera is able to take pictures (CAMERA CAPTURE) and to show the images on the display, but saving the pictures (CAMERA SAVE) is only saving a black picture with some small colored spots on a vertical line in the middle of the picture. With a picture on the display the SAVE IMAGE results in the same result. (Loading a BMP picture to the SD from the PC and then from the SD to the Micromite works perfectly. Once on the display I can also SAVE IMAGE back to the SD card without problems.) I have reconized -too late- that the display (SPI-type) is not the type that is proposed in the Micromite eXtreme documentation. It should have been a display with parallel data connection. Right? (I have preferred the SPI over parallel due to less wire soldering )I am now wondering if there is any cure to get my setup working properly? I have tried to search the forum, but I might have missed some important hints. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572 |
If you can capture the images then the camera side is all working fine. The image save works by reading the display memory. Sounds like the SDO(MISO) pin on the display isn't connected. Forget the camera and try using BLIT to test reading the display memory. |
||||
| Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 398 |
Display SDO, Touch DO and SD MISO are all connected to SPI2-IN on MMX (pin 47). Display SDI, Touch DIN and SD MOSI are all connected to SPI2-OUT on MMX (pin 41). Watching the SPI2-IN during [BLIT 10,10,50,50,100,100] shows low (0...1V) signals except a few 3.3V peaks at start and another few 3.3V peaks after 13ms. (In between these 0 to 1V). Looks like it tries to go high, but has not got enough "power". BLIT makes a black square in the picture. Tried also to add pull-up to 3.3V; 10k 3.9k and 1k without effect. During [CAMERA CAPTURE] the SPI2-IN signal swings between 0...3.3V for 49ms. Picture is captured OK. Is it OK to have also the SD connected to the same SPI2? |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572 |
Yes unless SD_CS is stuck low for some reason. The other one to check is that TOUCH_CS is pulled high if touch isn't configured |
||||
| Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 398 |
SD_CS not stuck low. Changed SD to SPI1. No difference, still not able to save pictures. Changed also SD_CS to a new pin on MMX; no effect. Tried different SD cards; no effect. Disabled touch; no effect. Added more capacitance to power supply; no effect. SD_CS keeps on making peaks to 0V with a frequency of about 30Hz after the SD has been in operation. After start up of MMX the SD_CS stays constantly at 3V until loading or saving a picture, after which the 30Hz pulsing starts and goes on "forever". Maybe this is normal? Situation: Camera works OK and I get the picture to ILI9341 OK. CAMERA SAVE or SAVE IMAGE not working. BLIT not working. The black pictures with some colored dots vertically on left edge and also vertically at center are all of size 230454 bytes. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572 |
Yes, this is just the background check that the SD card is still there. This is the critical diagnostic. Unless the code can read from the display BLIT can't work (and therefore CAMERA) so ignore camera until you get BLIT working. I've just checked an ILI9341 on MMX64 (BLIT and save image) and the firmware is working properly so either you have a wiring issue or (possibly more likely) the display itself has a fault |
||||
| Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 398 |
Thanks Matherp for the advice and checking/testing! Your results give me motivation to continue! I have tested with 4 different ILI9341 dispalys, all with the same result! I will have to check the wires once more...before that I have to go out and dig snow again. We have got plenty of it during the last weeks. Still able to see out from the windows, but not much longer. |
||||
| Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 398 |
Problem solved: Disconnected the display's touch T_DO (which was connected in parallel with the display's SDO [MISO]) and the SPI2-in signal to MMX started to swing 0...3V as it should. Now everything works as it should. Except for touch, which I do not need for the moment. Suppose I could connect that to SPI1 when I need it. The main thing is that the camera and storing pictures works. BLIT also OK. Many, many thanks to Matherp for the invaluable help!! OV7670 camera + ILI9341 display + SD card + Micromite eXtreme 64 is now OK. Just as Matherp demonstrated yesterday! |
||||
| Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 398 |
Now that the setup works I noticed that there seems to be some limitation for the number of pictures that can be stored after each other on the SD. I made a simple program loop that takes pictures and saves them on the SD. All goes as planned for the 32 first pictures. However, when the 33rd picture is to be taken (CAMERA CAPTURE), MMX reports: [15:21:23][7] Camera CAPTURE [15:21:23]Error: Not enough memory The SD is 2GB; it is definitely not that memory which is full! Are some parts of the picture files stored in the background in MMX or what could this mean? |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572 |
Think I've found it, please try the attached new firmware 2019-02-07_024535_Micromite.X.production.zip |
||||
| Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 398 |
You certainly did! Tested with 100 pictures without any problem. Is the firmware package only for 64 pin MMX or also for the ones with more legs? Programmed it with the PIC16F1455 programmer; Time 1m15s. Thanks again!!! |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |