View previous topic :: View next topic |
Author |
Message |
Milton
Joined: 19 May 2010 Posts: 2
|
Efficient writing to program memory |
Posted: Thu May 27, 2010 10:55 am |
|
|
I'm currently designing a muscle impulse recorder which is to be worn by a moth in flight. I have a pair of instrumentation amplifiers feeding into a PIC16F1936's analog input. I need to be able to record 8-bit input at ~1000 Hz sampling rate from both amplifiers for three to four seconds and store this data until I instruct the PIC to send out the data via serial. Since size and weight are critically important, I intend to store the data in the PIC's program memory but I am unsure of the most efficient way to do this- especially since my attempts to write to large blocks of reserved memory (using #ORG) seem to be very slow.
I am aware that this will rapidly use consume the 100,000 write limit of the memory. This, however, is not a major concern as long as a few minutes of operation are available. The system is designed to be disposable after that time.
If necessary, the sampling rate can be decreased but must not be less than 750 Hz. Read speed is not a major concern since I have several minutes to collect the stored data via my serial connection.
Is write_program_memory capable of satisfying the design requirements and, if so, what is the most efficient way of handling the data storage? |
|
![](templates/subSilver/images/spacer.gif) |
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Thu May 27, 2010 11:52 am |
|
|
i cant help you.... but i just wanted to say: thats awesome!!!....
wish i could see the moth with the PIC onboard.
g _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19359
|
|
Posted: Thu May 27, 2010 2:29 pm |
|
|
The problem will be the write time of the EEPROM. Typically 2mSec/byte, and 'worst case', 2.5mSec/byte. Would limit the maximum guaranteed rate to just 400bytes/sec. You need 2KB/sec (to handle two channels at 1000 samples/sec).
I did a similar logging unit some time ago, ended up using the smallest cheapest PIC I could find with the ADC, and added an FRAM memory. These have far better write time (just the time taken to clock the data in), so were much more comfortable for the application.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
![](templates/subSilver/images/spacer.gif) |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
|
Posted: Thu May 27, 2010 11:34 pm |
|
|
a moth can carry all that ?? PIC and a FRAM ?
Wonder what the moth is thinking about all this ? |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19359
|
|
Posted: Fri May 28, 2010 2:14 am |
|
|
In my case, the animal was fractionally larger. However we used the core 'chip', not the 'IC'. You buy what is basically the silicon wafer, just split up, and bond this directly onto your substrate. The total electronics was about 0.1g in weight. The hardest thing was power. For the unit I was involved with, this was fed in by an induction loop. For some large moths I can see it being relatively easy, but for some of the smaller species, I'd hate to be trying to do this!....
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
|
Posted: Fri May 28, 2010 3:14 am |
|
|
Another option (if you can get a small enough one) would be to use a PIC18 series device with more ram.Store the data in ram and as long as there is a supply to it you won't loose it.
A quick look showed the maximum size was 4K minus the amount required for your variables you may just have enough.
You would need a trigger to start the sampling such as a level on the ADC or just when supply is applied. And stop when the ram is full. |
|
![](templates/subSilver/images/spacer.gif) |
Milton
Joined: 19 May 2010 Posts: 2
|
|
Posted: Fri May 28, 2010 7:57 am |
|
|
For those interested, he's a picture of the previous version. This was small enough to be carried by the animal but it had to be powered by a bench power supply attached with wires. By cutting the size/weight in half or so, we're hoping to have enough remaining payload capacity to add a battery. The moth can carry ~.750g total.
Uploaded with ImageShack.us
Thanks for the responses. I have measured the write time for 8bytes and I get fairly long and inconsistent results so I believe your suggestions about external memory are the way to go.
Future requirements (a few digital I/O) preclude the use of the PIC 10 series but It seems like the 12F683 in a 3x3 DFN package should be suitable.
Eventually, we would like to replace the PCB/chips with epoxy-covered wafers. As the system continues to evolve, I'm hoping to go that direction for our smallest animals.
Last edited by Milton on Fri May 28, 2010 8:40 am; edited 1 time in total |
|
![](templates/subSilver/images/spacer.gif) |
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Fri May 28, 2010 8:13 am |
|
|
man, where do you work? are you hiring? hahahaha
freaking wicked! _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
![](templates/subSilver/images/spacer.gif) |
|