Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pic selection question

Status
Not open for further replies.

jaxart

New Member
What pic would handle the following task best? I was thinking a PIC 18f6520

Need to monitor 10 voltages with a high sample rate and at least 10 bit resolution. I also need the pic to be able to take those samples and store each sample in memory until i stop the monitoring. Once i stop i would then like to average the samples taken and out put them to an lcd

I can provide more details if needed

Thanks
 
Taking 10 bit samples at high speed (what is your idea of high speed?) will require a lot of memory for a very short time of sampling. Pic's, even the 18F series, don't have much ram so you're probably going to need some kind of external ram.
 
What i am trying to do is monitor battery voltage while it is discharging so i can plot the curve and then out put the average discharge voltage I am thinking of around 10 or 20 samples per second with an average sample time of around 500 seconds

Can this be done with a pic or do i need to go to an 8051 type microcontroller

Thanks
 
jaxart said:
What i am trying to do is monitor battery voltage while it is discharging so i can plot the curve and then out put the average discharge voltage I am thinking of around 10 or 20 samples per second with an average sample time of around 500 seconds

10 or 20 samples per second is a low sample rate, not a high one, it's a trivial task for a PIC. The biggest problem is the number of samples required, PIC's only have a very small data register area - nothing like the 10,000 to 20,000 required for your storage. The usual way of doing this is to store the results in I2C EEPROM, your sample rate should be low enough to do this (EEPROM is quite slow to write to). As you're talking 10 bit samples, each sample will use two bytes of EEPROM memory, unless you join multiple bytes together - where 4 readings can be stored in 5 bytes.

Your 500 second sample time seems very low for a battery discharge curve?, I'm presuming you're wanting to monitor really high discharge currents?.

Also, I don't really see the need for so many samples, as low as one sample per second should give you plenty of detail over 500 seconds, actually 0.2% resolution. Drawing the curve on a normal PC monitor will scale it down to this sort of resolution anyway.
 
Why not just output the data serially to a PC? Even hyperterminal is up to this task. The data can be stored as a text file and then easily imported to Excel for graphing and other manipulation.
 
How much memory would be suggested for a task like this. If i am monitoring 10 or 12 batteries at a time with a 5 S/s rate for an average time of 500 seconds that would be approx 30000 samples . Would a 512kbit external eeprom handle this speed and capacity or should I look at another solution

Thanks
 
Would this be possible

sample = 0
sample = sample + next sample until all samples are added then divide by total number of samples to give me an average of all samples

I know that the number will be larger than 8bit but I have seen possible maths with 24 and 32bit that should make this possible

Just wandering
 
Yes, if you just want an overall average then that'll work. you'll require 32Bit math to be on the safe side, that's no problem.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top