I can tell you right off the get-go, if you haven't built anything before, you'd better start small and work your way up. You'd be shooting yourself in the foot if you don't. Opinion...
At what sampling rate? 100 times per second? Once per second?I’m thinking to make Data Logger to log 4 batteries, 2 temperatures, frequency, and time 2% or less accuracy
Use a PIC18F4550 and you can use the serial port initially then switch over to USB. Cool points included.using 16k 18F4420 8mhz internal clock.
Easy enough to add a fair sized external 2 wire EEPROM. Why take the chance of messing up the PIC's operating system.I’ll be saving all the data in Flash. 100,000 life cycles is more than enough for my lifetime to use data logger.
Good plan...Before I start writing the program I’d like to consult with you guys what a proper way to do it. If you please can suggest anything, I'm all ears.
Whatever way you want to do it, as long as you take good notes and keep track of what you're doing.1) I have to write 32bytes in to Flash at a time. Let’s assume 8 adc at resolution 8bit samplings equal 8 bytes. Should I just make 32 variables each equal byte and take 4 samplings of 8adc channels and write all 32 variables at once to flash? Is it a proper way to do it? Let’s say I’ll be logging only 7adc channels and is it possible to use an Array of 32 bytes and once it is full or almost full it starts writing to flash automatically.
Starting to go downhill here... And by that I mean... Well, never mind.Is there a sample code like that so I can get an idea to modify for my application?
Suffice to say, if you write some code, and it doesn't look right, and/or doesn't work right, I'm sure a dozen people around here will stand up and give you a hand.
However, I don't have your hardware, I don't know how much you know, and I'm not going to use up a days upon days trying to explain every little thing.
Easy enough to use a crystal on the PIC and keep <1% accuracy, or again, easy enough to add on a 2 wire RTC for tigher accuracy.2) I’d like to be able to log time as well. Data logger will be logging under 20 minutes at a time. Time should be 2% or less accurate. What would be the best way to make 20 minutes clock using hardware interrupt or software without external RTC IC?
External eeproms are quick enough. You can get away with a write, wait 10ms (100hz) then write another byte. Or if your program is written right, you can use a page mode and write more data in practically the same time.If I use 100hz interrupt, I’m afraid it’d conflict with data logging.
Use USB and you don't have to worry about it.3) I’m going to import all the data to Excel and use charts. I found Parallax PLX-DAQ software but is there any better solution to do that? I’m going to use software rs232 command so I don’t have to use Max232 and make it simple. What’s the fastest baud rate I can use with 8mhz internal clock with a minimum error tolerance?
Generally speaking, using software SERIAL, 19.2K baud is what the book says. Using hardware serial, you'll have to check your datasheet for whichever PIC you want to use and see what the numbers show.
Bookmarks