Data logger clock and array


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Yeah I know. So far I love the forum, it's got so much info to learn from...

    Quote Originally Posted by skimask View Post
    You know this forum is Proton picbasic right?
    I was thinking to use Excel to change settings in microchip using PLX-DAQ or Realterm OCX example. I can adjust number of batteries, number temp sensors connected to pic just by using serout command to update EEPROM of Flash to store different settings.

    Quote Originally Posted by skimask View Post
    So Excel is going to talk to the PIC?
    Let's say I use interrupt for 1 second using 16bit timer. 8mhz / 4 cycles / 16bit timer 65536 = 0.000030517578125 multiply by 256 prescaler = 0.0078125. 1 second / 0.0078125 = 128. As I understand it should interrupt the software 128 per second. My guess it might conflict with a software running in the background or I'm wrong.

    I would love to hear more about that.
    Quote Originally Posted by skimask View Post
    PLX-DAQMake a whole bunch of 1 second clocks and keep track of them.PLX-DAQ
    Very simple, please read my previous post.

    Quote Originally Posted by skimask View Post
    Now that's classic... And just how do you suggest doing that? Chips without a PCB... Are you going to mount this stuff on wheat bread or Pringles chips or what?
    What exactly do you plan on datalogging again?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    Yeah I know. So far I love the forum, it's got so much info to learn from...
    Let me try that one again...

    You know this forum is for MeLabs PicBasicPro and not Proton Basic right?

  3. #3
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Let me try that one again...

    You know this forum is for MeLabs PicBasicPro and not Proton Basic right?

    Yeah I know. That's what I said I bought MeLabs PicBasicPro but I've used Proton lite to learn on

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    Yeah I know.
    Ok, just checking...

    That's what I said I bought MeLabs PicBasicPro
    Having trouble finding that particular sentence...

  5. #5
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Sorry I didn't say what data logger is for. This is just for Remote Control airplanes/helicopter so I know what battery voltage is and motor RPM, temperature of the battery and speed controller. The main reason to use minumum external parts so it is very light because every gram counts on small electric RC helicopters. Everything looks very easy to make since I already did everything bit by bit by writing to flash and reading from flash. Getting ADC to work properly in 8bit and 10bits and CCP to ger RPM from the motor. Debugging the pic using RS232 and HyperTerminal but I just can't figure it out how to make clock. Can anybody please tell me if my calculation is right?
    Let's say I use interrupt for 1 second using 16bit timer. 8mhz / 4 cycles / 16bit timer 65536 = 0.000030517578125 multiply by 256 prescaler = 0.0078125. 1 second / 0.0078125 = 128. As I understand it should interrupt the software 128 times per second. How do I figure it out if it will not conflict during ADC, CCP, EEPROM, CCP sampling, writing and erasing? I know I can disable interrupt routine during any of these sampling but it'll mess up the time. Is it even possible to do that without external RTC?
    Last edited by PicLearner; - 25th September 2008 at 01:40.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    Let's say I use interrupt for 1 second using 16bit timer. 8mhz / 4 cycles / 16bit timer 65536 = 0.000030517578125 multiply by 256 prescaler = 0.0078125. 1 second / 0.0078125 = 128. As I understand it should interrupt the software 128 times per second. How do I figure it out if it will not conflict during ADC, CCP, EEPROM, CCP sampling, writing and erasing? I know I can disable interrupt routine during any of these sampling but it'll mess up the time. Is it even possible to do that without external RTC?
    8Mhz / 4 = 2Mhz...
    Clocking a 16 bit timer off the instruction clock @ 2Mhz = 2Mhz / 65536 = 30.517578125 interrupts per second (have to take the 1/x of the result, that's the part you forgot).
    Set up the interrupt routine to count to 30, then take a sample. Yes, you'll be 16.69ms off for each second, unless you reload that particular timer at each interrupt with a correction factor to make it exactly one second. Look up the phrase PIC Multi-Calc.
    If you clock an 8 bit timer off the instruction clock @ 2Mhz, 2Mhz / 256 = 7812.5 interrupts per second. Set up that interrupt routine to count to 7812, then take a sample. With the 8 bit timer, you'll only be 65us off in each second.

  7. #7


    Did you find this post helpful? Yes | No

    Talking

    Ok, I have been watching this thread and I have to jump in. I understand that every gram counts in an RC chopper, I have built some from scratch. The dead bug approach to soldering the PIC without a circuit board is not a good idea. I suggest you take as thin a pcb as possible, use a 16F88 or something with 18 to 20 pins in a SSOIC package, ICP setup will be your best option. You can then buy from RFM or similar an ASK 4mm square surface mount 900Mhz TX. You can then assemble all of these components and it should not weight more 5gm. I know because I have done it. The RX side is an ASK receiver connected to a serial port on your pc. TX every 1sec and log it on laptop PC, write your own app or buy an app, there are lots out there. My advise is intended to save you hours of wondering why things don't work.

    Nick

  8. #8
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    8Mhz / 4 = 2Mhz...
    Clocking a 16 bit timer off the instruction clock @ 2Mhz = 2Mhz / 65536 = 30.517578125 interrupts per second (have to take the 1/x of the result, that's the part you forgot).
    Set up the interrupt routine to count to 30, then take a sample. Yes, you'll be 16.69ms off for each second, unless you reload that particular timer at each interrupt with a correction factor to make it exactly one second. Look up the phrase PIC Multi-Calc.
    If you clock an 8 bit timer off the instruction clock @ 2Mhz, 2Mhz / 256 = 7812.5 interrupts per second. Set up that interrupt routine to count to 7812, then take a sample. With the 8 bit timer, you'll only be 65us off in each second.
    Oh my god, it looks so much simpler after you explained it to me. I've been reading about the timer and I still was wrong but after your explanation it is so clear to me now. Thank you!!!!!!! Just to make sure about prescaler. For example using 16bit timer with a prescaler 1:1 it would interrupt approximately 30 times per second and using prescaler 1:2 it should interrupt approximately 60 times. Is it correct?

    I was just reading thread about instruction execution time by Darrel Taylor and after testing I can easily calculate what it takes to do ADC, CCP, etc. Probably I can even make a simple software clock and add to the clock execution time to compensate missing nanoseconds/milliseconds. I think interrupt clock is much easier and faster to write but what would you recommend interrupt or software clock?

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, 14:41
  2. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 23:31
  3. PIC HSERIN problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 20th July 2008, 12:08
  4. Using SPI with External Interrupts
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th June 2008, 05:08
  5. 16-bit SPI problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th June 2008, 16: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