Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • tonton81's Avatar
    Today, 04:35 PM
    T3.6 host, T3.5 slave, T3.2 slave, 24 mhz all round :) i tried different speeds between both but one slave gives up data flow unless the speeds match Weird.. but both set at same speed work fine :)
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 03:53 PM
    LOL Mike Guess we know this works? :P https://www.youtube.com/watch?v=xD9TTK5cL6g
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 01:39 PM
    I'm pretty sure Tim could prolly pass 5K Hz in his setup if im able to reach 4745 with a T3.5 :P, and 3110 Hz with a 3.2 :P
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 01:36 PM
    Alright mike, try this use 24000000, NOT 30000000 then try this: uint32_t OverTime = 0; void loop() { static uint32_t _timer = millis(); teensy_gpio.events(500); if ( !(millis() % 100) ) { ...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 01:33 PM
    Mike, main issue, its not the library Select 24000000, the T3.5/T3.2 cant do 30 it seems! I'm tweaking the millis code in loop now, but above post stands working without any library mods..
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 01:30 PM
    Hey look where im at now: 47436.00, #, #, #, #, #, #, #, #, #, #, #,80771,25
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 01:29 PM
    note, im getting this btw: 19600.00, #, #, #, #, #, #, #, #, #, #, #,12357,24 ill find a sweet spot and report back to you for testing..
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 01:27 PM
    Ok, Im getting close, let me work on it, i just got it running at least, ill tweak it out and let you know, the LC ill work on later, to add it's SPI registers as they are different, hopefully we can get those online on...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 12:57 PM
    I hope I find it, im warming up the solder gun, and after dismantling everything, so no more 3.6+3.5 setup after this lol would be nice if tim could report the latest thread copy working against 2 of his 3.6's, since...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 12:48 PM
    Just letting you know im home now, before i dismantle everything in the setup its still running 4745Hz with 0 OT on T3.5/T3.6, :) 35552.00, #, #, #, #, #, #, #, #, #, #, #,275635072,58226 _time==50 F&F...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 07:58 AM
    Mike, maybe ill find time later today to rip my setup apart, solder pins to one of my t3.2ís, and hook up a 3.5 to a 3.2 for testing on my setup. maybe this way i can finally see the issues your describing with 3.2ís,...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 07:44 AM
    Tim, for ring buffer list() https://forum.pjrc.com/threads/50008-Project-SPI_MSTransfer?p=176301&viewfull=1#post176301 is this okay or you want other formatting options?
    45 replies | 1529 view(s)
  • tonton81's Avatar
    Today, 07:30 AM
    ouch! code brackets??? :o
    20 replies | 42084 view(s)
  • tonton81's Avatar
    Today, 04:15 AM
    still blasting here at 4745 Hz f&f’s :) even if you got the 3.2 working at 1sec delay, thats a good starting point to tweak the different timing areas to see where it crashes
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Today, 04:10 AM
    did u try modifying MHZ, or added delay to “slowdown” in H file? remember we set > 12mhz no delay? theres a setting somewhere u dont have setup i think
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 10:13 PM
    i hope you truly installed the latest copy :) i havnt touched it since i posted it on #1353... its not on github..
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 10:00 PM
    go higher, exagerate if you have to, its micros() so try like 33333, maybe ur 3.2 cant handle a faster micros? if i go 300 or below i get what you got on #1368, when i go over 400 no issues, even works when i put 10000...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 09:32 PM
    #1368 will happen if you DON'T specify the value Find your sweet spot so we can update it as default :) default is 100 (uS) , 400 or higher is working on my t3.5 slave
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 09:28 PM
    this is the one im running ATM non stop, OT still 0, 4746 Hz F&F's Master: #include <SPI.h> #include <SPI_MSTransfer.h> #include "A_ConfigDefines.h" //#define SPI_SPEED 30500 #define SPI_SPEED 30000000...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 09:23 PM
    did you specify events(value)??? specifically 500 or higher? the 3.2 might need higher value keep slave at events(0) only change master
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 08:41 PM
    WITH THE T3.5 OC @ 168MHZ SLAVE:::::: 0 == 4745 @ 200 uS !!!!!!!!! 1 == 4745 @ 200 uS !!!!!!!!!!!!! 2 == 2367 @ 400 uS Tim???????????????????????????????????????????????? :)
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 08:26 PM
    No lags at that rate at all, using 700 micros for events() and 400micros timer! its always within 2376 -> 2378 no jumping, no lag, STABLE! results!! above is with OVERLOAD 1 with OVERLOAD 2, to stop...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 08:25 PM
    THIS at 30mhz stock CPUs 38440.00, #, #, #, #, #, #, #, #, #, #, #,544494,39051 2376 ,10 38452.00, #, #, #, #, #, #, #, #, #, #, #,544495,39051 void loop() { static uint32_t _timer = millis(); ...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 08:18 PM
    Holy crap tim!! 58300.00, #, #, #, #, #, #, #, #, #, #, #,94627,35295 2115 ,9 58324.00, #, #, #, #, #, #, #, #, #, #, #,94629,35295 thats modifying TVmaster timer to micros instead of millis, this: if (...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 08:16 PM
    For TVmaster tho, events() should be in main loop, not timed...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 08:13 PM
    64784.00, #, #, #, #, #, #, #, #, #, #, #,49499,0 ALC==100 micros() _time==52 F&F (OT=24) OT_CALC==100 micros() _time==51 F&F (OT=24) OT_CALC==100 micros() _time==52 F&F (OT=24) OT_CALC==100 micros()...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 08:13 PM
    Mike, from the github, I loaded TVmaster and TVslave demo "as-is" and wow its flooding like crazy! working well!...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 07:42 PM
    Tim, I'm working on Circular_Buffer, I added list() support for ring buffer: It outputs: Queue Size: 7 Queue entries: -3.14 -12.35 -78.91 -7.91 -11.91 -58.91 -18.91 Is this okay or you want other info...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 06:23 PM
    I want you to try my code since it's working, just to check your setup: events() is mandatory I2C will never print without events() Master: #include <SPI.h> #include <i2c_t3.h> #include "A_ConfigDefines.h"...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 04:26 PM
    Added FULL dequeue capability for slave data retrieval. This unloads the entire slave dataqueue as soon as the data flag is set, ive set the slave at 5ms tight loop transfer16's to master, and master is catching em...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 03:29 PM
    Getting ~62 uS for overload 0... Normal ACK Getting ~52 uS for overload 1... F&F Getting ~ 5 uS for overload 2... QUEUE static uint32_t _t = millis(); if ( millis() - _t > 1000 ) { _t = millis(); ...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 03:09 PM
    Hello all, currently testing the QUEUE implementation originally, its working well! teensy_gpio.events(0); delay(100); static uint32_t _t = millis(); if ( millis() - _t > 1000 ) { _t = millis(); ...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 12:50 AM
    Slave's been pumping out since I left today, its still rolling along! :D didnt crash yet! I fixed Don's issue so my deed for the night is done, tomorrow I'll see what I can do with MST...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    Yesterday, 12:46 AM
    tonton81 replied to a thread uNav INS in General Discussion
    I am going to assume the above is correct. I commited the changes for you at the repo: https://github.com/tonton81/Circular_Buffer/commit/081d531256313d4c30713318361a4d4622dc5ee2 You can download the new update
    599 replies | 12288 view(s)
  • tonton81's Avatar
    Yesterday, 12:37 AM
    tonton81 replied to a thread uNav INS in General Discussion
    Is this correct max being closer to 0??? sketch snippet: Circular_Buffer<float, 16> myFloats; myFloats.push_back(-3.14159); myFloats.push_back(-12.3456); myFloats.push_back(-78.91234); ...
    599 replies | 12288 view(s)
  • tonton81's Avatar
    Yesterday, 12:29 AM
    tonton81 replied to a thread uNav INS in General Discussion
    Ok just to confirm, .max() should be closer to 0 right? and .min() is further back? .min(): -78.91 .max(): -3.14 -78.91234 -58.91234 -18.91234 -12.34560 -11.91234 -7.91234 -3.14159 min max correct?
    599 replies | 12288 view(s)
  • tonton81's Avatar
    Yesterday, 12:25 AM
    tonton81 replied to a thread uNav INS in General Discussion
    Ok Don, I'm home now, I'll fix it soon
    599 replies | 12288 view(s)
  • tonton81's Avatar
    04-18-2018, 11:59 PM
    well not really more filled, the secondary one was just if the first was “in-transition” otherwise i see no benefit in filling ones less full, especially if ordering is required, wait, thats also a doorstopper right...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 10:47 PM
    either way, this is looking good, ill spend some quality time on it :) if you got suggestions for tackling dual buffer system rather than a single only problem is can the isr fire 2x or more faster than the loop? im...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 10:31 PM
    that was in teensquitto thread i think :)
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 08:16 PM
    tonton81 replied to a thread uNav INS in General Discussion
    it’s also my fault, i started search at 0... T _find = 0; I should have started searches from endpoints... Also if you got a small snippet of just the CB to test against that would be nice, while i patch the lib i...
    599 replies | 12288 view(s)
  • tonton81's Avatar
    04-18-2018, 08:10 PM
    tonton81 replied to a thread uNav INS in General Discussion
    if that works its just a matter of printing the tail-1 after calling ascending, simple library fix using already implemented methods :) edit, if that works, i might use it for .min() as well, to be safe both ways
    599 replies | 12288 view(s)
  • tonton81's Avatar
    04-18-2018, 08:04 PM
    tonton81 replied to a thread uNav INS in General Discussion
    on the other hand, this mine be a ONE LINE patch! can you do a quick test for me? im not home try this make your queue to ascending order, (i hope c++ std:: orders them right) via CB.sort_ascending(); then get the...
    599 replies | 12288 view(s)
  • tonton81's Avatar
    04-18-2018, 07:58 PM
    tonton81 replied to a thread uNav INS in General Discussion
    Cool, is there a special way to calculate it then? I could always correct that error OH! I know what you mean now, ill figure it out tonight/tomorrow
    599 replies | 12288 view(s)
  • tonton81's Avatar
    04-18-2018, 06:51 PM
    Not saying this is a solution or not, based on just test you could try to modify the NVIC register of Wire to be higher priority than interval timer, it worked for me using SPI interrrupts, stopped Wire from crashing :)...
    2 replies | 61 view(s)
  • tonton81's Avatar
    04-18-2018, 05:28 PM
    Just swapped out the uint16_t for atomic bool, library seems to work with it... std::atomic<bool> SPI_MSTransfer::_slave_queue_active = ATOMIC_FLAG_INIT; std::atomic<bool> SPI_MSTransfer::_slave_dequeue_active =...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 04:38 PM
    OH MY!! Tim, I blasted the slave to write 0ms loops and ran ONLY events(0) in master loop, it was scrolling crazy with all data intact!!! i had to close the console it was flooding with the payload! :)
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 04:32 PM
    Well according to the console, all the data is comming in with uint16_t, so I can assure you we're safer now than we were with bool at the moment! :) We can always "update" the variables later on to std::atomic later...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 04:27 PM
    Tim, I've implemented the slave sending to master protection while writing, its working great now with the volatile uint16_t (even though im only using 0 and 1 value!) Should we do the CBA split, where half is...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 04:20 PM
    OK: Heres a log: VOLATILE BOOL: 1 0 1 0 1 0 1 0 1 0 1 0 1 0
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 04:15 PM
    Tim, this bool was holding me back wondering why half the time the slave was dequeueing nothing even though it said one queue, but the master never received it, in 1 sec intervals. ALL I DID WAS CHANGE BOOL -->...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 04:12 PM
    Question, I'm guessing BOOLs are not atomic? I seen Paul mention that uint8_t and other data needs multiple calls whereas native 32 writes are done in a single instruction? I setup the master to ONLY pull slave...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 03:21 PM
    Here's the example I did when I wrote the lambda handler for I2C: _wire_callback_active = 1; _wire_callback_readpos = 0; mtsca.push_front(buf, buf); ...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 02:58 PM
    Hey Mike, I had a brilliant idea... I was thinking of doing like I did to the lambda function, where the methods KNOW it's active or not... Just think for a moment, what if we create an additional CBA with 2...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 01:34 PM
    Last night I was so tired looking through the code... then when I woke up, I didn't even know how I walked to bed, I don't remember... I was just in bed lol...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 01:13 PM
    ok Mike, not to worry, it's a mix of problem... It's probably not events, but I have to fix the ISR switch statements first... The reason is theres a ISR flag & return in the wrong spot that I found and now im getting...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 12:56 PM
    ok i just wanted to make sure if older events worked on slave end while the latest thread test version was commented out on master, its puzzling but if i have to follow the steps in events() slave is getting the f&fs...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 12:00 PM
    yes i know, this happened since queue implementation, the events is suppose to fire when slave TELLS master its ready, can you try without events loaded on master with latest version, and try the github version flashed...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 07:31 AM
    Also please confirm if removing events() with latest copy here works in uNav (obviously sending data only to slave)
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-18-2018, 04:12 AM
    yes i know, still working on it but i goto work soon :) if you comment out events()/remove it, master is sending fine i have to see where its crashing to fix it tomorrow if i have time (double shifts) post #1319...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 06:38 PM
    i narrowed it down, your sketch is running with the first section of events() commented out need to see where its crashing in there now
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 06:31 PM
    Heres another interesting thing, comment out events and try F&F's... its running fast! that means, its crashing somewhere in events()...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 06:10 PM
    Ok I figured it out, well not really, just narrowed it down... It's working if events() is in a thread, but not in a single nonthreaded sketch, it's something in events() I gather, gonna have to poke around to see...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 05:32 PM
    It's something stupid on master sketch, only master sketch, I write yours, I see that lag, I write mine, it rolls along nicely... still trying to pinpoint it...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 05:00 PM
    This is the master/slave im using testing F&F's Master: //#include "FastLED.h" #include <SPI.h> #include <i2c_t3.h> #include "A_ConfigDefines.h" #include <SPI_MSTransfer.h> #include "TeensyThreads.h" #include...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 04:55 PM
    https://www.youtube.com/watch?v=mhww6IfFbMo
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 04:51 PM
    events() ? post your code? :)
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 04:46 PM
    I tested transfer16's: OT_CALC==100 micros() _time==9 ACK PacketID 60: 5uS OT_CALC==100 micros() _time==10 ACK PacketID 60: 5uS OT_CALC==100 micros() _time==10 ACK PacketID 60: 5uS
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 03:23 PM
    The speed of the recovery is faster too now, to fire the lambda Keep in mind that the lambda fires only if the slave was ever reset, hotplugging doesnt count because the slave hasnt reset, so no need to reset it's...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 03:16 PM
    Ok, nailed it! if ( wire_port != -1 ) { if ( _wire_callback_active ) { uint8_t _shift = mtsca.peek_front() - available(); for ( uint16_t i = 0; i < size; i++ ) { if (...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 01:44 PM
    Yes, this was a problem for state check for slave to master data as well, the same system shares the queues, so this would fix those slow slave data capture issues
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 01:21 PM
    Hi Mike, I just got home from work, and I think I just found the bug too! Hope it works for you :) When I added the state checking, I was doing it the original way where it shifts the different state in first and...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 01:15 AM
    Theres still some timing things to work on for i2c, but at least i got it capturing payloads properly. I'll work on it tomorrow cuz i need a power nap before work ;P
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 01:01 AM
    Master: #include <SPI_MSTransfer.h> SPI_MSTransfer W0 = SPI_MSTransfer("Wire", 43, &SPI2, 30000000 ); void setup() { Wire.begin(I2C_MASTER, 0, 0, 0, 0, I2C_PULLUP_EXT, 100000, I2C_OP_MODE_IMM); ...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-17-2018, 12:13 AM
    Don't worry mike, i found that pesky bug that makes yours work or not, it turns out one of the calls deasserted and further down it did another SPI dword transfer before deasserting again, because it was already...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-16-2018, 10:53 PM
    Heres the peek() call from within the callback: Method hijack: (same as read, but no incrementer) if ( _wire_callback_active ) { if ( _wire_callback_readpos >= mtsca.peek_front() ) return -1; ...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-16-2018, 10:45 PM
    Ok now check the ::read() method: if the callback requests this: for ( uint16_t i = 0; i < count+2; i++ ) { Serial.print(W0.read()); Serial.print(" "); } Serial.println(); Keep in mind the 2 additional...
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-16-2018, 10:20 PM
    Hey hey, this is fun :) Alright, check this: W0.read(buf, count); is different between normal and in callback. In normal mode, it requests to read from the slave's port directly
    1395 replies | 29289 view(s)
  • tonton81's Avatar
    04-16-2018, 09:46 PM
    Here's the current working version for the last posts:
    1395 replies | 29289 view(s)
More Activity
About tonton81

Basic Information

About tonton81
Biography:
Seriously? ;)
Location:
Montreal, Canada
Interests:
computers, micros, telecoms, gate systems, access systems, security systems, cars
Occupation:
sorter/driver/shipping

Statistics


Total Posts
Total Posts
2,011
Posts Per Day
4.12
Last Post
Project: SPI_MSTransfer Today 04:35 PM
General Information
Last Activity
Today 06:00 PM
Join Date
12-18-2016