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 | 337 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 | 337 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 | 337 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 | 337 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 | 337 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 | 337 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 | 177 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 | 177 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 | 177 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 13745 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 | 211 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