Hi all, I have a project that is capturing image using a camera and string the images in micro SD card using a microcontroller.
Camera link is below. http://www.tigal.com/1787
Interface: RS232 Min size of SD card support required is 1GB.
Since the camera sends the image data in Snapshot Picture Preview (RAW) Picture JPEG Picture these formats, I would like my controller to receive them as it is and store them in SD card either using file system or without file system (No complex processing). Controlling the camera will be done by my controller.
My questions are: 1. Does a windows computer can read an image file without file system (Raw image)? 2. Which controller will be cheep and best for this project (Cheep evaluation board is better; I can’t invest more than 200USD). 3. To interface SD card, LPC is having dedicated pins for them. So selecting LPCxxxx series would be better option.
"string the images in micro SD card"
What do you mean by that?
What is "stringing" an image?
"Camera link is below http://www.tigal.com/1787 "
That is very popular amongst amateur/hobbyist users - you should easily be able to find examples of its use!
Note that the Datasheet is also linked from that page: download.tigal.com/.../uCAM-DS-rev4.pdf
You will obviously need to study this document!
"Does a windows computer can read an image file without file system"
Yes - provided you have suitable software to do it!
"Which controller will be cheap and best for this project"
If all you're doing is receiving the data from the UART and dumping it straight to the SD Card, then pretty much any controller should be able to do that! Probably the cheapest at the moment (all under $50?) are: www.st.com/stm32-discovery http://ics.nxp.com/lpcxpresso/ http://www.mbed.org focus.ti.com/.../ekk-lm3s811.html
"To interface SD card, LPC is having dedicated pins for them"
You don't need dedicated pins - any SPI will do.
In fact, I think you will find that using "dedicated SD pins" requires you to use the full SD protocol - which, I think, you will find to be more complex than SPI.
"So selecting LPCxxxx series would be better option."
Possibly not - see above.
But there are also plenty of other microcontrollers with "dedicated SD pins"
Note that, apart from some 8051-based chips, just about all of NXP's microcontrollers are called "LPC..." - so saying "LPCxxxx series" is, essentially, just asying "an NXP chip".
Thank you for your reply Andrew. And thanks for the links.
>>string the images in micro SD card Indented to be storing the image in micro SD. Sorry for the typo.
>>>>"Does a windows computer can read an image file without file system"
>>Yes - provided you have suitable software to do it!
I dont understand this, do does a special customized software application needs read the image file? cant every PC read the image without any dependency?
Flow is that trigger the CAM, get an Image, name it as Image1.jpeg and store it in SD card using same name, get an other image next time, name it as Image2.jpeg and store it in SD card using same name, and it goes on.
The camera has a RS232 interface. A PC can collect the serial data coming in and write it to a file, not?
You said you wanted to be able to store on the SD-Card without a file system.
The file system is the means by which Windows knows how to read the data from the card. So, if there is no file system, Windows does not know how to read the data - you have to supply the software that understands the non-file system that you happen to use on the card!
Of course, if you do use a file system that Windows understands - then Windows will be able to read it!
Are you, perhaps, misunderstanding the meaning of "raw" image data? This just means that the data is in the "raw" format from the sensor - not processed as JPEG, etc.
This has nothing to do with the storage on the SD-Card - you could store "raw" or "cooked" data with or without a file system!
"get an Image, name it as Image1.jpeg and store it in SD card using same name"
If you're going to store it as files then you obviously need a file system!!
Thanks for keeping this post alive.
>>Tamir says, The camera has a RS232 interface. A PC can collect the serial data coming in and write it to a file, not?
Correct. But i believe i have not mentioned anywhere that i can use a PC to interface the Cam directly. Reading from SD card and displaying is the only scope of the PC as of now. But if i go without file system, i understand from all Andrew's reply that i have to write a PC based application to read them and format them into file format. But please read this post further.
>>>>I dont understand this, do does a special customized software application needs read the image file? cant every PC read the image without any dependency? again typo. I restate this here Do we need a software application running on PC to understand the Raw file and read the raw data from SD card and convert them to .jpeg correct image format?
Flow is that using my controller trigger the CAM, get an Image, name it as Image1.jpeg and store it in SD card using same name, get an other image next time, name it as Image2.jpeg and store it in SD card using same name, and it goes on. Whenever i want to see the images stored in the SD card, just remove the SD card from controller SD slot and view it on any PC by connecting to it.
>>Andrew says, If you're going to store it as files then you obviously need a file system!!
Buying a file system is out of my financetial scope and implementing any free file system such as chan's file system, will take much of my development time but i will have to consider this for better life but not now.
According to the datasheet of microCam,
4.2 GET PICTURE (AA04h) The host issues this command to request a picture from the uCAM. 4.2.1 Picture Type Snapshot Picture 01h Preview (RAW) Picture 02h JPEG Picture 05h
So i assume that the Cam can send me in a file format (ex JPEG if i send o5h), still i have to name it as Image1.jpeg, Image2.jpeg to store them on SD card.
Try this one - it rocks:
elm-chan.org/.../00index_e.html
"i believe i have not mentioned anywhere that i can use a PC to interface the Cam directly"
Tamir's point was that you could avoid all the microcontroller and SD-Card issues by simply connecting the camera direct to the PC's COM port.
Had you considered that?
"Do we need a software application running on PC to understand the Raw file and read the raw data from SD card and convert them to .jpeg correct image format?"
If you store in "raw" format, then you will obvisouly need to convert that if you want it in JPEG or any other format!
>>Tamir's point was that you could avoid all the microcontroller and SD-Card issues by simply connecting the camera direct to the PC's COM port.
Thanks for your reply and I understood that. But when i discussed the project, would not above be the first idea to come in anyone's mind, since it occured to me at first.
wont this gives any clue? since the Cam is sending in a specified file formate (.JPEG), cant i take as it as to SD card? But i think the possibility is less. correct?
Your camera gives jpeg images, so there is no "raw" sensor data requiring any program for conversion.
My assumption is that you want to use the SD card because you want to capture images from the camera without any PC available, and at a later time either connect your device to a PC or remove the SD card and connect to the PC to retrieve the connected photos.
You can find free file system implementations to use, so you don't have to write your own. But you will have to adapt the file system for your hardware, since a generic file system will not know how to read and write a sector using your specific hardware.
If you want to move the SD card into the PC and have the PC see the images without special software, then you do need a file system.
If you are ok with writing a custom application then you have multiple options.
One option is to have the PC write a huge "dummy" file to an empty FAT16 or FAT32-formatted SD card (should result in this file being stored in a continuous sequence of sectors). Then you can create your own simple system for storing image data, time stamps etc and a customized PC program can retrieve the data and mark the internals of this huge "dummy" file as empty. This is quite ugly, but possible. Internally inside the container file, you can store your image data as a variant of a linked list. Store header info + image data. Potentially pad to start of next sector for next header info (file name + size + capture time) + image data.
Another option is to skip any file system completely on the SD card and just store the image data in whatever format you want. But it will make it a bit harder for the PC program to pick up the data since it needs to perform raw accesses to the SD card. And the customer who puts the SD card into a memory card reader will be told that it doesn't contain any valid file system and asked if it should be formatted. So this is every uglier - there is a good chance that the user will reformat and lose all captured data.
A third option is to keep the SD card in your device and have a custom PC program use the serial port to retrieve captured images from your device. Then you can use a similar serial protocol as the camera does for retrieving the photos. And you can use whatever allocation scheme you can think of for storing the image data on the SD card without having to consider what will happen if the card is placed in the PC. One disadvantage is that the serial port will not be as fast when retrieving the data as the raw read speeds you get from a directly connected SD card.
The nicest method - and the only that doesn't require special PC software - is that you do use a standard file system, and do require the user to move the SD card from your device to the PC. With a real file system, you can then also with ease add logic to erase files on the card using some suitable policy if the SD card goes full because the user forgot to erase the files that was copied to the PC, or because the user left your device to capture photos for too long time.
So why don't you just connect the camera to the PC, then?
What is the point of complicating the issue with a microcontroller and SD Card??
What, exactly, is your goal here?
www.catb.org/.../smart-questions.html
Connecting to a PC COM port would probably be a good exercise anyhow - for you to gain familiarity with the camera, its operation, and its capabilities...
According to the details quoted, the camera has the option to provide "RAW" data.
www.lmgtfy.com
Hi Andrew, I think i didnt explain you clearly, Final product cant be connected with any PC because that there will not be any PC available. But only to become familiar with camera functionality, i can use very well use your idea.
As i mentioned in my old post >>Whenever i want to see the images stored in the SD card, just remove the SD card from controller SD slot and view it on any PC by connecting to it.
I store the images in SD card and use a PC to view the captured photos.
As per said i will consider implementing free file system or use the second option.
For the first option, in a FAT formatted SD card if we write any raw data ex: Spiwrite("Nice to discuss my issues here", 30);, wont it destroy the file system?
I think you are still confused about the different meanings of "raw" data.
In the context of this discussion, it is used with 2 distinct meanings:
1. "raw" data from the camera; ie, unprocessed data direct from the image sensor.
2. "raw" access to the SD-Card; ie, directly accessing the sectors of the card without regard to any file system.
Clearly, writing directly to the sectors of the card without regard to any file system will corrupt any file system that happens to be on the Card!
"Final product cant be connected with any PC because that there will not be any PC available."
You didn't even mention that!