Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: tonton81

Page 1 of 10 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    198
    Views
    16,452

    You have "X" amount of mailboxes in TX mode, if...

    You have "X" amount of mailboxes in TX mode, if you constantly write faster than they deplete they wont be able to output and a return of 0 will occur until at least one is available to write. Next,...
  2. Replies
    198
    Views
    16,452

    If you have more than one mailbox accepting the...

    If you have more than one mailbox accepting the same frames, then they can be in any order. Thats why people have 2 options.
    Ordered by FIFO, or run single mailbox mode (reject the rest or switch...
  3. Replies
    198
    Views
    16,452

    All bits (0x14) must be set to checked so no you...

    All bits (0x14) must be set to checked so no you cannot omit it, the hardware will simply toss it out as bad match, everything else is ok.
    Your filters are done in hardware for best performance, so...
  4. Replies
    198
    Views
    16,452

    Are you looking to only save 2 IDs? Mailboxes can...

    Are you looking to only save 2 IDs? Mailboxes can be completely custom configured. If you plan to use filtering it is highly recommended to put your priority ID filters in the leading mailboxes and...
  5. This may be slightly off topic but i am using...

    This may be slightly off topic but i am using skpang's board and able to use both external and usb at same time, i havnt checked the datasheet or if the trace was cut as i ordered them together to be...
  6. Replies
    176
    Views
    13,237

    Some features are specific to arrays, some to...

    Some features are specific to arrays, some to buffers, most work on both. It wouldn't be ideal to have seaparate names when there are alot of features to be handled would increase the function list,...
  7. Replies
    176
    Views
    13,237

    Cb.remove is a unique feature implemented...

    Cb.remove is a unique feature implemented specifically for circular arrays, not circular buffers. The function only processes on circular arrays, and exits on buffers. It's used to drop an entire...
  8. Replies
    176
    Views
    13,237

    Ok, I corrected the offset needed of memmove on...

    Ok, I corrected the offset needed of memmove on peekBytes, and readded it to readBytes, both function correctly. It's been updated on github, let me know if you still have issues :)

    My last...
  9. Replies
    176
    Views
    13,237

    Thank you, I will check into that and fix it when...

    Thank you, I will check into that and fix it when I get back home
    readBytes is good now?
  10. Have you tried a different compiler optimization?...

    Have you tried a different compiler optimization? Smallest is default for LC, what happens when you try Fastest? Compilers sometimes may optimize things out, if there are code issues
  11. Replies
    176
    Views
    13,237

    Ok try the patch ...

    Ok try the patch

    https://github.com/tonton81/Circular_Buffer

    Test example:



    #include "circular_buffer.h"
  12. Replies
    176
    Views
    13,237

    can you post a full sketch i can load it to a...

    can you post a full sketch i can load it to a standalone teensy to test? Last post is a snippet

    EDIT, nevermind, I see the issue with readBytes. That will need to be fixed.
  13. Replies
    176
    Views
    13,237

    Serial.printf("%lu: cb_trans contains = %d...

    Serial.printf("%lu: cb_trans contains = %d elements\n", millis(), cb_trans.back()- frontptr);


    Have you tried using the now pointed to array as references? &frontptr &xxxx.back() etc
    ...
  14. Replies
    176
    Views
    13,237

    Front and back are just a pointer in CBA....

    Front and back are just a pointer in CBA. Example:

    cb_trans.front()[2];

    This basically gives you the data stored in indice 2 of the front of the queue. Same goes for back(). This is just a...
  15. Replies
    176
    Views
    13,237

    The type for the buffer, is guarenteed to be the...

    The type for the buffer, is guarenteed to be the type you used in the template constructor. uint8_t, it is impossible for the compiler to generate a different type than the one you specified to the...
  16. Replies
    176
    Views
    13,237

    Have you checked .size() for number of elements?...

    Have you checked .size() for number of elements? Perhaps your calculation is wrong, try size() to confirm

    back() and front(), by the way show the byte in either head or tail of the queue

    In...
  17. Replies
    176
    Views
    13,237

    Dont worry, theres more features there than you...

    Dont worry, theres more features there than you realize, which makes data entry and data lookups one of the excellent features of circular arrays. :)
  18. Yes when i made the function in previous...

    Yes when i made the function in previous libraries in past i made them weak, in case some other user code or library implemented their own.
  19. Replies
    176
    Views
    13,237

    1 is correct, but back is a READ pointer as well....

    1 is correct, but back is a READ pointer as well. Thats how you pull LIFO.
    size and available are the same, due to common usages between programmers, spme may prefer one over the other. Capacity is...
  20. That is true, but in the case of a T3.2 there is...

    That is true, but in the case of a T3.2 there is only one bus instantiated.
    On a T3.6, you can instantiate 2 CAN controllers, except this time unlike last libraries, choosing one won't duplicate...
  21. Replies
    176
    Views
    13,237

    I could add print(ln) to circular arrays, it just...

    I could add print(ln) to circular arrays, it just wasnt added because it was just implemented in the buffer instead. If i do add it, though, since text has an arbitrary size, you will need the...
  22. Templates are awesome, objects are created during...

    Templates are awesome, objects are created during compile time, very different than run time objects. FlexCAN_T4 demonstrates how compile time objects can be linked to run time objects, in order to...
  23. Replies
    176
    Views
    13,237

    print_test is a multidinensional array. The print...

    print_test is a multidinensional array. The print functions are for the circular buffers not circular arrays, it stays at 0 because the function aborts. This is expected
  24. Replies
    176
    Views
    13,237

    When you do a read it pulls the item out of...

    When you do a read it pulls the item out of queue, by the time you check the size it'll be empty
  25. Replies
    126
    Views
    6,987

    Mailboxes are there even though you use FIFO or...

    Mailboxes are there even though you use FIFO or not, depends how advanced the configuration is set by the user. FIFO technically can't tell you how many are in queue (1-6), only yes or no, typically...
  26. Replies
    126
    Views
    6,987

    It will return 0 of there are no more messages...

    It will return 0 of there are no more messages filling one or more mailboxes. 1 is returned when at least one mailbox was read of an available message. There is no other way of counting especially if...
  27. Replies
    126
    Views
    6,987

    What do you mean? ((Can0.events() & 0xFFF000) >>...

    What do you mean? ((Can0.events() & 0xFFF000) >> 3) will show if there are frames in queue (in interrupt mode). Is that what you meant or you mean polling mode? None exists at the moment for poll...
  28. Replies
    10
    Views
    212

    Don't forget when changing the SPI mode to do a...

    Don't forget when changing the SPI mode to do a dummy read before asserting the line to communicate, this will put the clock to a known high or low state for next transfer and probably wouldnt have...
  29. Replies
    126
    Views
    6,987

    Do you have proper termination on the lines?...

    Do you have proper termination on the lines? Verify the transceiver is not crosswired to the CAN network as well, the code looks ok so far, and your printing to serial monitor what your sending as...
  30. Replies
    387
    Views
    12,651

    Yes, USB3 supports ~1500mA on the port itself...

    Yes, USB3 supports ~1500mA on the port itself while USB2 supports 500mA, thats why USB2 drives require a 2nd USB port for power (1A combined) while USB3 can just use a single port

    All USB3 drives...
  31. Replies
    126
    Views
    6,987

    You can't modify msg in callback because its read...

    You can't modify msg in callback because its read only, you can copy it then modify the copy

    CAN_message_t theCopy = msg; // copy it
    theCopy.seq = 1;

    The data 0xFF looks good, just make sure...
  32. Replies
    126
    Views
    6,987

    You can send both onReceive to same callback if...

    You can send both onReceive to same callback if you wish to handle it in one function, each frame has a msg.bus (1,2,3 is returned for CAN1,CAN2, amd CAN3.

    To send frames ordered sequentially, you...
  33. Yes printing too fast can actually lag the java...

    Yes printing too fast can actually lag the java window enough that the IDE freezes to a halt
    Same thing happens with full page refreshing in canbus debugger im working on, 1ms can lock up the IDE...
  34. Replies
    126
    Views
    6,987

    Yup that looks good, will add it today or...

    Yup that looks good, will add it today or tomorrow as a 2.0 example, the FD beta example needs to be updated as well.
  35. Replies
    126
    Views
    6,987

    Try using Can0.setClock(CLK_60MHz) then do...

    Try using Can0.setClock(CLK_60MHz) then do setBaudRate after that, check if you have timing issues with that after. I am using skpang's breakout board in my car with a retail Teensy 4, it has triple...
  36. Replies
    126
    Views
    6,987

    Looks good but only put Can0.events() in the...

    Looks good but only put Can0.events() in the loop, onReceive needs only be set once in setup, just move that to setup and remove the while loop

    The return value is used by TeensyCAN, 12 bits...
  37. Replies
    126
    Views
    6,987

    On a side note you can also use...

    On a side note you can also use Can0.setMBFilterRange(MB0, 0x800, 0x805); since the IDs are within a tight range

    You may also have a callback per mailbox, like have 0x800 goto one callback, 0x801...
  38. Replies
    126
    Views
    6,987

    Can0.enableMBInterrupts(); is needed to enable...

    Can0.enableMBInterrupts(); is needed to enable all mailbox interrupt receptions (unless you rather poll as in your example)

    For the callback, you can call Can0.onReceive(canSniff); and add the...
  39. Replies
    126
    Views
    6,987

    You dont, it already ended when it hit the...

    You dont, it already ended when it hit the callback. If you can calculate the bytes by length and the stuffing bits need to be considered, ill have to read up on the details but would be a nice...
  40. Replies
    126
    Views
    6,987

    The counter is not needed you just need to time...

    The counter is not needed you just need to time each frame, local timer, and how many, based on their data lengths:

    Check the last post on the NXP forum:
    Link
  41. Replies
    126
    Views
    6,987

    The hardware will not pass in corrupted frames,...

    The hardware will not pass in corrupted frames, they are CRC validated, before it hits the software end. If you are curious try reading the data while a OBD tester tool is plugged into the OBD port,...
  42. Replies
    126
    Views
    6,987

    You didn't do anything wrong, perhaps your car is...

    You didn't do anything wrong, perhaps your car is using extended frames and not standard, this can be normal. The OBD responses on 2006+ cars are mostly extended id responses.

    If you are writing...
  43. Replies
    14
    Views
    3,006

    FlexCAN_T4 works on Teensy 3.2, 3.5, 3.6, and 4.0...

    FlexCAN_T4 works on Teensy 3.2, 3.5, 3.6, and 4.0
    You can also use IFCT for Teensy 3.x
  44. Replies
    126
    Views
    6,987

    The clock can be changed using setClock, default...

    The clock can be changed using setClock, default for Teensy 3.x is 16MHz, you can try up to 60MHz on T4

    If there is an error in the setBaudRate function it's been there since the original...
  45. Replies
    126
    Views
    6,987

    CAN2.0 or FD mode? If CAN2.0 you can use 307200...

    CAN2.0 or FD mode?
    If CAN2.0 you can use 307200 for the speed
  46. Replies
    1
    Views
    115

    You mean like the sending struct? ...

    You mean like the sending struct?



    CAN_message_t msg;
    msg.id = 0x123;
    msg.flags.extended = 0;
    msg.len = 8;
    msg.buf[0] = myTemperature;
    Can0.write(msg);
  47. Replies
    64
    Views
    16,027

    Tie a gpio to reset pin ?

    Tie a gpio to reset pin ?
  48. Replies
    9
    Views
    284

    Calling new and delete dynamically will destroy...

    Calling new and delete dynamically will destroy your heap, not recommended for microcontrollers, be careful :)
  49. Replies
    13
    Views
    280

    Try lowering the I2C rate to 100000 and/or try...

    Try lowering the I2C rate to 100000 and/or try the alternate Wire library as a test, as for the wiring we can only assume you followed the site but we can't physically see that until you post pictures
  50. Replies
    426
    Views
    88,535

    Dont know if this also helps, but the time slices...

    Dont know if this also helps, but the time slices of each thread can be changed which affects how long task switching stays in that thread, i had to adjust my time slices when i ran multiple uart...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4