Free 186 More Best Homemade Tools eBook:  
New: 300+ fresh build posts/day from 275 forums → BuildThreads.com

User Tag List

Results 1 to 3 of 3

Thread: Bridging the Gap Between Realtime and Data in an Arduino

Threaded View

  1. #1
    Supporting Member rgsparber's Avatar
    Join Date
    Nov 2012
    Location
    Phoenix, AZ
    Posts
    1,392
    Thanks
    802
    Thanked 3,091 Times in 741 Posts

    rgsparber's Tools

    Bridging the Gap Between Realtime and Data in an Arduino

    The difficult place to debug is at the boundary between the real world and software. I can use my 'scope to look at the voltage on a given input pin as a function of time. I do this with high confidence in the information. I can also insert print statements into my code and know where it is going. But if I use software to look at a signal associated with an input pin, I will affect its realtime performance. On many occasions, these extra print statements ended up being why my program didn’t work.

    I am proposing a program that temporarily replaces the existing code. After triggering on a change in state, it only looks at the input, and as fast as it can, saves it to memory. After taking 255 samples, it stops recording and starts printing it out to my PC. Then the cycle repeats.

    The user defines which pin they want to read plus the sampling rate. With my Pro Micro, I can sample as fast as every 6 microseconds. This will be faster than my program can read the input so I get a good idea of what it sees. There is no limit on how slowly I sample if I'm looking for slow moving disturbances.

    If you are interested, please see

    https://rick.sparber.org/DigitalRecorder.pdf


    Your comments are welcome. All of us are smarter than any one of us.


    Thanks,

    Rick
    Rick

  2. The Following 3 Users Say Thank You to rgsparber For This Useful Post:

    anrivera1 (Jul 7, 2020), Jon (Jul 9, 2020), Paul Jones (Jul 7, 2020)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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