Data logger clock and array


Results 1 to 18 of 18

Threaded View

  1. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    I just want to say hello since I’m new to PBP.
    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...

    I’m thinking to make Data Logger to log 4 batteries, 2 temperatures, frequency, and time 2% or less accuracy
    At what sampling rate? 100 times per second? Once per second?

    using 16k 18F4420 8mhz internal clock.
    Use a PIC18F4550 and you can use the serial port initially then switch over to USB. Cool points included.

    I’ll be saving all the data in Flash. 100,000 life cycles is more than enough for my lifetime to use data logger.
    Easy enough to add a fair sized external 2 wire EEPROM. Why take the chance of messing up the PIC's operating system.

    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.
    Good plan...

    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.
    Whatever way you want to do it, as long as you take good notes and keep track of what you're doing.

    Is there a sample code like that so I can get an idea to modify for my application?
    Starting to go downhill here... And by that I mean... Well, never mind.
    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.

    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?
    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.

    If I use 100hz interrupt, I’m afraid it’d conflict with data logging.
    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.

    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?
    Use USB and you don't have to worry about it.
    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.
    Last edited by skimask; - 24th September 2008 at 14:16.

Similar Threads

  1. Bit Angle Modulation (BAM) in a PIC
    By Bronx68 in forum mel PIC BASIC Pro
    Replies: 150
    Last Post: - 24th February 2015, 13:41
  2. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  3. PIC HSERIN problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 20th July 2008, 11:08
  4. Using SPI with External Interrupts
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th June 2008, 04:08
  5. 16-bit SPI problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th June 2008, 15:42

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts