Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • paynterf's Avatar
    01-22-2020, 07:05 PM
    defragster, Good suggestion. I edited the ReadMe to include the links
    20 replies | 204 view(s)
  • paynterf's Avatar
    01-21-2020, 11:43 PM
    All, I have updated the Teensy sniffer on my Github account to allow its use with any I2C slave device via a #ifdef MPU6050_SPECIFIC pre-processor switch. By default this switch is disabled, so the code will operate...
    20 replies | 204 view(s)
  • paynterf's Avatar
    01-21-2020, 03:38 PM
    Never mind. I found this post that explains the problem. Apparently the Arduino pre-processor 'sees' the #include line before it 'sees' the #ifdef/#endif block - bummer. So, to generalize the code I'll use #define...
    20 replies | 204 view(s)
  • paynterf's Avatar
    01-21-2020, 02:54 PM
    Anyone, I have been trying to generalize my I2C sniffer for all I2C devices. Only the code that computes a yaw value from a 28-byte packet returned from a MPU6050 register is specific to the device; everything else...
    20 replies | 204 view(s)
  • paynterf's Avatar
    01-19-2020, 02:28 PM
    Defragster, The only MPU6050-specific feature is the ability to recognized and decode the 28-byte DMP FIFO packet containing accelerometer data (this is the only thing the helper_3dmath.h library is used for). If you...
    20 replies | 204 view(s)
  • paynterf's Avatar
    01-19-2020, 02:20 AM
    I believe I have finally succeeded in creating a usable I2C sniffer, somewhat specialized for monitoring traffic between an I2C master and a MPU6050 slave. The complete sniffer program is available from my Github...
    20 replies | 204 view(s)
  • paynterf's Avatar
    01-18-2020, 02:24 PM
    Defragster, wow - FASTRUN did the trick; went from 1.45 uSec to 0.89 uSec - thanks! If anyone ever had any doubts about the value of Paul's forum, this thread shows it; I had never heard of FASTRUN before this...
    7 replies | 155 view(s)
  • paynterf's Avatar
    01-18-2020, 01:16 AM
    Joe, Thanks for the quick reply - that's a great idea combining the two values into the same 8-bit word! Your first suggestion, uint8_t last_current = (last_portb << 4) | (current_portb); bIsStart =...
    7 replies | 155 view(s)
  • paynterf's Avatar
    01-18-2020, 12:26 AM
    Hi, I'm working on a Teensy 3.2 I2C Sniffer project, and I have an ISR that triggers every 1 uSec using Timer1. I have instrumented the ISR with 'digitalWriteFast()' calls so that I can monitor activity on an...
    7 replies | 155 view(s)
  • paynterf's Avatar
    01-08-2020, 01:09 PM
    Tonton81, OK, thanks. Maybe functions that only operate on circular arrays could have a '_array' appended to their name, like 'remove_array'? Frank
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-08-2020, 03:11 AM
    tonton81, Have you verified that cb.remove(element) actually removes the element? Here's a partial output from my current program, where I parse through a capture buffer to remove invalid bytes, and I have included...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-06-2020, 12:59 PM
    The Teensy I2C sniffer project now works properly with tonton81's circular buffer library (although without the latest peekBytes() fix - I'm still using peek()). Here's the output from just one pass through the...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-06-2020, 03:51 AM
    It appears that peekbytes() might have an issue too. Here's my (somewhat messy, sorry) code in its entirety: /* Name: Teensy_I2C_Sniffer_V6.ino Created: 1/4/2020 8:40:20 AM Author: ...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-05-2020, 01:13 AM
    I'm trying to use cb.ReadBytes() in a function, but it doesn't seem to be working the way I would expect. Here's the function //uint8_t Get7BitDeviceAddr(byte * simdata, uint16_t & readidx) uint8_t...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-05-2020, 12:29 AM
    I understand they are just pointers, but why is there a difference of 1852 between the front and back pointers of a 928-byte 8-bit-per-element circular buffer? The inference is that it takes 2 pointer locations to...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-04-2020, 09:51 PM
    So, the 2x factor between size, and the difference between the front() and back() values?
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-04-2020, 08:36 PM
    Sorry == forgot to mention that for the 'zero interval' output I also commented out the 'cb_trans.clear()' call to let the FIFO contents build up to max capacity. Frank
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-04-2020, 08:21 PM
    Changed the print line to Serial.printf("%lu: cb_trans contains = %d elements\n", millis(), cb_trans.size()); And now I get for output: Opening port Port open 5701: cb_trans contains = 928 elements
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-04-2020, 08:06 PM
    Tonton81, OK, size() returns 928, as expected. Changing the %d to %u for front()-frontptr doesn't change anything. Maybe Circular_Buffer<uint8_t, 2048> cb_trans; //holds transition values from ISR is...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-04-2020, 07:57 PM
    Tonton81, OK, size() returns 928, as expected. Changing the %d to %u for front()-frontptr doesn't change anything. Maybe Circular_Buffer<uint8_t, 2048> cb_trans; //holds transition values from ISR is...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-04-2020, 06:37 PM
    I created a small program to test the idea of using a circular buffer for my I2C Sniffer program. An ISR that triggers every microsecond from Timer1 reads an 8-bit value from a fixed array containing previously captured...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-04-2020, 01:32 PM
    Thanks for the quick response! I'm going to try and use your circular buffer class for my I2C Sniffer project, and I'm sure I'll have more questions ;-).
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-04-2020, 12:22 AM
    Hmm, so I modified the c5 section of the example to obtain a more detailed printout, as follows uint8_t idx = 0; Serial.printf("Idx\tdata\t\Head Idx\tTail Idx\n"); while ( c5.size() > 0 ) { ...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-03-2020, 03:18 AM
    So I'm studying the output from the example, trying to figure out what's going on, but I gotta say it's a bit of a slog. It appears that the c5 section is supposed to be demonstrating what happens when data is...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-03-2020, 02:12 AM
    Never mind - I figured it out. The RAM requirements for the example just barely exceeded the available 64K on the T3.2, but plenty of room on a T3.5 ;-) Program circular_buffer_example size: 19,832 bytes (used 4% of...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-03-2020, 01:48 AM
    Tonton81, I just cloned your repo and tried to compile the circular_buffer_example sketch for a Teensy 3.2. I got a compile error as follows: circular_buffer_example.ino.elf section `.bss' will not fit in region...
    176 replies | 13332 view(s)
  • paynterf's Avatar
    01-02-2020, 03:26 PM
    Here's the Teensy 3.2 code for parsing a small sample of I2C communications with a MPU6050 IMU. The data used here are the same as the ones used for my previous Excel VBA project, but it turned out that the algorithm...
    10 replies | 172 view(s)
  • paynterf's Avatar
    12-28-2019, 09:07 PM
    No, the FIFO class constructor does not use serial. Other member functions do use serial occasionally for debug, but only well after all of setup() has run. Using a recent Win10 Dell XPS15 9750, and I don't have any...
    3 replies | 88 view(s)
  • paynterf's Avatar
    12-28-2019, 07:48 PM
    If I change the delay value inside the while() loop from 100 to 500, then the loop will reliably terminate with idx = 3. However, for lower delay values, the reliability goes down, until with delay(10) it will always...
    3 replies | 88 view(s)
  • paynterf's Avatar
    12-28-2019, 07:28 PM
    I have a very simple program to test a FIFO class, as follows: /* Name: FIFO_Class_Test.ino Created: 12/28/2019 12:51:15 PM Author: FRANKNEWXPS15\Frank */ #include "FIFO_Class.h" FIFO...
    3 replies | 88 view(s)
  • paynterf's Avatar
    12-28-2019, 03:56 PM
    defragster, Yes, the plan is to port the VBA code to a Teensy 3.2 I have lying around, (and maybe later to a Teensy 4!). Yes, I think time-tagging has merit, especially, as you said, when things go wrong. But...
    10 replies | 172 view(s)
  • paynterf's Avatar
    12-28-2019, 03:27 AM
    I've created an Excel VBA program that correctly parses an arbitrary I2C transmission stream. See my Paynter's Palace post here for all the gory details. As noted in the post, I'm still not sure what is causing the...
    10 replies | 172 view(s)
  • paynterf's Avatar
    12-28-2019, 03:21 AM
    Oops, forgot that Kito's program reverses the SCL & SDA lines: When the lines are switched to conform to the code, I get Opening port Port open ----------------- Legend: S=Start Sr=Start repeat P=stoP ...
    10 replies | 172 view(s)
  • paynterf's Avatar
    12-28-2019, 12:34 AM
    tele_player, Here's some output from the original un-modified Kito code using the same test program. Judge for yourself: Opening port Port open ----------------- Legend: S=Start Sr=Start repeat
    10 replies | 172 view(s)
  • paynterf's Avatar
    12-27-2019, 12:01 PM
    tele_player, I was hoping to avoid the cost of a Beagle, as my per-hour labor cost these days is zero $/0 ;-). I have tried to use Kito's original program (and still use his transition capture routine), but his...
    10 replies | 172 view(s)
  • paynterf's Avatar
    12-27-2019, 02:47 AM
    Well, I finally figured out how to remove the NOP bytes from the data stream, and as a result my Excel VBA program will correctly parse the entire capture buffer (minus the NOPs, of course). When I parsed a repetitive...
    10 replies | 172 view(s)
  • paynterf's Avatar
    12-26-2019, 04:04 AM
    I have been playing with Kito's I2C sniffer code with a Teensy 3.2 connected to a MPU6050. In order to understand what is going on, I wrote a small test program to hold a VERY simple conversation with the MPU6050...
    10 replies | 172 view(s)
  • paynterf's Avatar
    12-18-2019, 08:55 PM
    manitou, Hey, thanks! I did (or thought I did) a pretty thorough Google search for 'I2C Sniffer', but somehow missed this one ;-) Frank
    7 replies | 140 view(s)
  • paynterf's Avatar
    12-18-2019, 08:31 PM
    Frank B, Thanks for the additional information. If you had read the OP, you would have seen that the square wave generation experiment was just that - an experiment to see how fast I could loop through a simple set...
    7 replies | 140 view(s)
  • paynterf's Avatar
    12-18-2019, 07:55 PM
    Paul, Thanks for the links to the other threads - that explains a lot. However, I'm still a bit confused, as the same "Blink" code on the venerable UNO runs at 93KHz with a clock that's over 4 times slower than the...
    7 replies | 140 view(s)
  • paynterf's Avatar
    12-18-2019, 03:28 AM
    Hi, I'm thinking of using a Teensy for a I2C sniffer, and am experimenting to see how fast I can loop through a small program to toggle a single output line (Teensy Blink without the delay). On my O'Scope it appears...
    7 replies | 140 view(s)
  • paynterf's Avatar
    12-17-2019, 02:58 PM
    Hi, Any chance the Teensy 4.0 has support for wireless remote programming? I'm currently using Arduino UNO & MEGA on some robotics projects, primarily because of the ease of remote/wireless programming. I have...
    2 replies | 168 view(s)
  • paynterf's Avatar
    12-17-2019, 02:46 PM
    Wonderful - outmoded before I even get started! ;-). FWIW, I figured out how to do a pull request to add the "I2CDEV_IMPLEMENTATION I2CDEV_TEENSY_3X_WIRE" section to i2cdev.h, and I just got notified that it has...
    3 replies | 163 view(s)
  • paynterf's Avatar
    12-16-2019, 02:59 PM
    I also went back and figured out how to create a pull request for the modification to i2cdev.h, so (assuming the pull request is accepted), the only thing required to use I2CDev for Teensy would be to edit i2cdev.h in...
    3 replies | 163 view(s)
  • paynterf's Avatar
    12-16-2019, 02:26 AM
    Hi, As part of an effort to troubleshoot problems with motor noise causing my MPU6U050-enabled robot to crash intermittently, I decided to change controllers from my current UNO-based system to the Teensy 3.2. ...
    3 replies | 163 view(s)
  • paynterf's Avatar
    12-14-2019, 06:44 PM
    This still seems to be a problem, with the latest Teensyduino installation. Frank
    7 replies | 8565 view(s)
No More Results
About paynterf

Basic Information

Statistics


Total Posts
Total Posts
79
Posts Per Day
0.08
Last Post
Teensy I2C Sniffer for MPU6050 01-22-2020 07:05 PM
General Information
Last Activity
01-22-2020 07:05 PM
Join Date
06-17-2017