Editing Blinking Blues
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | Having some trouble with arduino blink. Will write up here. Draft now, not enough to really be of use to anyone but me. | |
= Origin = | = Origin = | ||
− | I have been messing about with steppers and simple drivers for some time. Recently I put a logic | + | I have been messing about with steppers and simple drivers for some time. Recently I put a logic analizer into use and noticed that the switching wave forms were a bit off. Simplifying this I went back to the basic blink and took a look at it. It also had some anomolies. This began an investigation of various blink code and the results. So far I have not found code that gives good results. In this investigation I am focusing on using pulses with half periods of 500 and 5000 micro ( not milli ) seconds. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Blink = | = Blink = | ||
Line 21: | Line 11: | ||
The blinks I worked with for this investigation were all in the 1 to 10 ms or so period time frame. I used only the microsecond built in functions. I expected that the timings would: | The blinks I worked with for this investigation were all in the 1 to 10 ms or so period time frame. I used only the microsecond built in functions. I expected that the timings would: | ||
− | * be repeatable in the range of a few microseconds | + | * be repeatable in the range of a few microseconds. |
− | * be accurate in the range of 10 to 20 microseconds | + | * be accurate in the range of 10 to 20 microseconds. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== What I Found == | == What I Found == | ||
Line 45: | Line 29: | ||
=== Issues Investigated === | === Issues Investigated === | ||
− | * Was the logic sniffer the glitched one: Do not think so, I generated a square wave on an | + | * Was the logic sniffer the glitched one: Do not think so, I generated a square wave on an ossicalator at 1KHz ( period 1 ms ) and looked for glitches in it. Nothing found. |
− | |||
− | |||
− | |||
− | |||
== Things Yet to Try == | == Things Yet to Try == | ||
Line 60: | Line 40: | ||
= Some Results = | = Some Results = | ||
− | In the image below the data from the arduino is being measured on channel 3, the test signal from the oscillator is on channel 5 and the rest are grounded or some sort of junk I have not gotten rid of. Click on it to go to a page with the image and then again to go full size which I did not do here to reduce the clutter. This measurement shows the good pulses. I typically use the sniffer cursors 1 to 4 for four consecutive good pulses. A good pulse is one very near the desired one, for example aiming at 10.00 ms I may get 10.120 ms. I actually expect some extra time ( perhaps not this much ) as there is some overhead in the routine. A bad pulse is typically off by much more ( 11.360 ms ) | + | In the image below the data from the arduino is being measured on channel 3, the test signal from the oscillator is on channel 5 and the rest are grounded or some sort of junk I have not gotten rid of. Click on it to go to a page with the image and then again to go full size which I did not do here to reduce the clutter. This measurement shows the good pulses. I typically use the sniffer cursors 1 to 4 for four consecutive good pulses. A good pulse is one very near the desired one, for example aiming at 10.00 ms I may get 10.120 ms. I actually expect some extra time ( perhaps not this much ) as there is some overhead in the routine. A bad pulse is typically off by much more ( 11.360 ms ). In both cases the good and the bad are consistent across many periods. The most consistent result is that bad pulses are separated by about 81.92 ms. And 81.92 / 16 meg Hz = 256 * some power of 10. That it comes out at the magic number of 512 seems very significant, but I am not sure why yet. |
− | |||
− | |||
− | |||
− | |||
− | + | [[File:measure1.gif|600x300px]] | |
− | + | Bad pulse from the same test run: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== More Results in Files == | == More Results in Files == | ||
− | |||
− | |||
* Arduino Code -- I keep adding to it, but the old subroutines that have been timed are not changed. It consists of 4 files that need to be unzipped into a directory called Blinkers and then opened with the arduino software. It is hosted on a google drive at: [https://drive.google.com/file/d/0B4yCTDKKk1cYUnV1MkRuZ0p6VzQ/view?usp=sharing Blinkers] | * Arduino Code -- I keep adding to it, but the old subroutines that have been timed are not changed. It consists of 4 files that need to be unzipped into a directory called Blinkers and then opened with the arduino software. It is hosted on a google drive at: [https://drive.google.com/file/d/0B4yCTDKKk1cYUnV1MkRuZ0p6VzQ/view?usp=sharing Blinkers] | ||
− | * Results spreadsheet: contains some of the measurements I have taken from the logic sniffer. It is in open office format. | + | * Results spreadsheet: contains some of the measurements I have taken from the logic sniffer. It is in open office format. |
− | * Sniffer project files. They are all zip and hosted on a google drive at: [ | + | * Sniffer project files. They are all zip and hosted on a google drive at: []. These files can be opened with the logic sniffer software found at [https://www.lxtreme.nl/ols/#download Logic sniffer software download] |
= Test Setup = | = Test Setup = | ||
Line 133: | Line 59: | ||
Logic sniffer is the dangerous prototypes single board device http://dangerousprototypes.com/docs/Logic_Sniffer_101 | Logic sniffer is the dangerous prototypes single board device http://dangerousprototypes.com/docs/Logic_Sniffer_101 | ||
− | Measurement taken using the cursor measurement, finding some good pulses at the beginning and then visually scanning, then measuring for bad pulses later on. All recorded to a spreadsheet, that | + | Measurement taken using the cursor measurement, finding some good pulses at the beginning and then visually scanning, then measuring for bad pulses later on. All recorded to a spreadsheet, that will be uploaded here. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Who I Told = | = Who I Told = | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Not Yet, but On My List == | == Not Yet, but On My List == | ||
= Links I Looked Over = | = Links I Looked Over = |