Hi guys, thanks for this awesome device.
I’m try to rez an old project from the shelf, I need to transfer a video from the unit to a server, it could be a sequence of images or a video, wherever is easier/faster.
On my last attempt I had achieved between 5 and 10 fps using the serial camera and a G120.
The best so far is 2 fps using the ALCAM and the same G120 taking pictures to the MCU as fast as it goes in the smallest resolution.
I’m trying to find if it is just the image acquisition that is slow or it is the communication interface that is slowing down things.
I’m using the SPI interface with the default example in the zip file for the ALCAM, I noticed that every time that I increase the bus speed (from 1000 Kbps) the text on the banner and version get corrupted, it is suppose to work up to 24000 Kbps but I can get above 1000 Kbps, do you guys have any idea why? I’m using the SPI3 in the G120 and SPI2 for the network card using the example code included in the zip file.
Any advice of how to get a video directly into the MCU? (as a different method)
Thanks in advance
@ Mogollon -
“Any advice of how to get a video directly into the MCU”
=> No, not same GHI library, there is no Register class
What the speed you get corrupted data? Can you please check wires please, remember that at 24MHz may need short wires.
We reduced to 1MHz in example because it is general for other slower platforms (Adruino or mBed) but I believe that it must be higher than 1MHz, because my current example is 4Mhz.
we didn’t test ALCAM on G120 (it was on EMX) but will take a look on G120 to see what happens.
@ Dat - Increased the speed up to 2Mhz and it is fine, tested 4 and 5 Mhz and started to get corrupted data.
*** Wires are 10 to 15 cm long, it may be just that.
In any case at 1MHz is not slowing down the frame transfer, I think the camera is just taking that long to acquire a pic.
Is there any way to get faster pictures updates into the MCU?, I’m getting 1 every 500ms (taking pics inside a loop).
@ Mogollon -
what screen size do you set in configuration?
@ Dat - The smallest one QQVGA_160x120
Takes 500 ms aprox. to send to the MCU using SPI at 1Mhz, same thing using 2Mhz.
This is using JPG format, if I switch to BMP takes 1.1 seconds!
@ Mogollon -
Something wrong in the way you read/write SPI frame.
At that resolution, the speed about 30-50ms / picture (20-30fps). If you connect PC to ALCAM by serial then open ALCAM explorer software, set UART baudrate 1Mb/s, select capture image -> streaming image to PC, you will see how smooth it is.
Please note that the ALCAM example is not for best performance, It is basic for general platforms, there are some lines set sleep(xxx)… which can be replaced by polling data… If you use exactly that example, then it might slow.
I think there are few gaps between to commands to capture an image.
The SPI speed configuration does not effect to this issue, I think.
@ Dat - I use the ALCAM example for SPI interface, I will check the code for a delay/sleep somewhere to see why it is so slow.
Did you tested the spi PictureToHost procedure just to discard that the SPI may not be working well?
Found it, the ALCAM.cs file has the following code:
private void SendCommand(string cmd)
this.alcam.Write(Encoding.UTF8.GetBytes(cmd + '\n'));
And there is the 500ms delay
Wow, how did such a huge delay get in there? Lol