Building CMUcam4 C Environment - Need Help
Kye
Posts: 2,200
I'm working on making a C environment for programing the CMUcam4 in. In particular I need to make to customized cache driver for XMMC mode and then build some assembly functions for capturing image data and doing other low level things. I need the cache driver to support sharing of the I2C bus and work at 1 MHz.
Where should I start?
Where should I start?
Comments
By the way, your board looks very nice! I just looked at the SparkFun page for it. Quite impressive!
I'd like to avoid have to work on parts of the code I do not absolutely need to edit. So, I'd like to reuse I2C code and serial code from propGCC for this project.
---
Once I get everything working I will need to edit all the cache driver code and such to support the ability to turn off. I need to be able to shutdown all cores but core 0 and lower the clock frequency to RC slow to reduce power consumption. I can work on this after getting an image differencing environment setup.
I need to use XMMC because I will be using 19200 bytes of memory for a frame buffer. I anticipate that I will run out of code space once external libraries are included.
I have 64 KB of EEPROM on board for XMMC. I do not want to use an SD card because it will increase the static current draw. I can run at about 600 uA on my black Lextronic CMUcam4 model when sleeping.
---
What I'll be making is a C interface library for the CMUcam4 for frame differencing. So, I plan to document everything I do. However, I am also doing all of this for a class I'm taking called energy aware computing where the class project involves building some computer system that is aware of its energy draw and tries to reduce it. My project is to use the CMUcam4 to monitor any changes in the room and turn the lights and HVAC system on when the room is occupied. I have to combine smart sampling of the room for occupancy with the goal of drawing as little current as possible. The goal for the project is to make the final device smarter than the PIR motion detector sensors in rooms which turn the lights off on you when you sit down for too long.
Thanks,
Since this code is in hub memory it won't cause a cache miss and hence the cache driver won't be called. The trick, of course, is to make that function as small as possible. Do all of the complicated stuff in code that lives in external memory and do the minimum I2C driver access code in this function.
However, you may still run out of memory since you'll need to allocate some space to the cache. If you're going to be using almost 20K for buffer space that doesn't leave much for your other program data and the cache.
I understand you're doing a new version of your CMUcam for Parallax. Any chance you would consider adding a Quad-SPI flash chip to it for xmmc use? Even a regular SPI flash chip would be faster than trying to run xmmc code from the EEPROM.
Take a look at the schematic and see where you could put it... The only really unused pin is the TV_C pin which is used for TV broadcast stuff. Since my TV driver just does baseband that pin could be used for CS. Then the rest of the pins could be shared with the SD card. The camera D0 and D1 pins are also unused... but, I reserved them for future use.
I would add it... but, I don't want to change the hardware for such that a firmware for my last two designs aren't compatible with the Parallax board.
I can make some solder mask jumpers available on the board. This will allow you to switch in new functionality when you want by manually modifying your board.
Thanks,