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.03 seconds.

  1. Replies
    359
    Views
    24,940

    very odd, there is no trickery in the read...

    very odd, there is no trickery in the read (polling) function, and it doesn't play with timers, interrupts, or other hardware, just reads the memory of the mailbox, what happens if you comment out...
  2. Replies
    359
    Views
    24,940

    found the problem? I don't think the I2C has any...

    found the problem? I don't think the I2C has any influence on flexcan it should work fine, the triple CAN board from skpang uses an I2C display addon.
  3. Replies
    359
    Views
    24,940

    which specific subroutine causes it to not work?...

    which specific subroutine causes it to not work? (you said read one..?which)
  4. Replies
    359
    Views
    24,940

    have you tried starting the I2C before and after...

    have you tried starting the I2C before and after flexcan begin?
    do you have a sketch?
    have you tried different I2C clockspeeds?

    did you try modifying the flexcan clock?
    Canx.setClock(CLK_60MHz)...
  5. Replies
    7
    Views
    300

    i don't know if this optomizes out, not a...

    i don't know if this optomizes out, not a compiler expert, but it does quiet the compiler
    (void)rs;
  6. try to disable slave's NVICIRQ before modifying...

    try to disable slave's NVICIRQ before modifying it for master, maybe it's stuck in there when the peripheral transitions and it's not handled
  7. be sure spi.begin() runs first before having tft...

    be sure spi.begin() runs first before having tft take over
  8. you should be able to copy the relevant spi bus...

    you should be able to copy the relevant spi bus block in tspislave and run that in your sketch to switch to slave, but just need to run spi.begin after to control the lcd then
  9. if the slave is ready though to accept...

    if the slave is ready though to accept calibration data from another mcu the tft SI/SO lines may interfere in the data process, even if only one of it's line is tri-stated, so data corruption will be...
  10. you can't use master and slave on same bus at...

    you can't use master and slave on same bus at same time, or switch, well, you can switch but you need to change the whole bus configuration to do so every time. better to use 2 spi busses

    if you...
  11. Replies
    359
    Views
    24,940

    think of a mailbox as just a queue. now all your...

    think of a mailbox as just a queue. now all your data is in queues.

    When you do a Can2.read(msg), that is actually polling the mailboxes, and not interrupt driven. You can start with that for now...
  12. Replies
    359
    Views
    24,940

    you can lower the mailbox count if needed,...

    you can lower the mailbox count if needed, example, instead of 64 mailboxes, you can setup 8, so you can store up to 8 latest frames. or, with FIFO, you'll have 6 latest frames with 8 transmit...
  13. Replies
    359
    Views
    24,940

    it is a bit confusing at first, think of each...

    it is a bit confusing at first, think of each mailbox as a random queue to hold incomming frames, can also be referred to as a message box. if you have 64 mailboxes, without reading any of them, you...
  14. Replies
    359
    Views
    24,940

    Check the link in the first post, it has a large...

    Check the link in the first post, it has a large readme, plus there are a couple examples in there. Some brief comments about functions can be found in the source file, but if you are looking for...
  15. Replies
    359
    Views
    24,940

    yes msadie you're right, FIFO wasn't meant to be...

    yes msadie you're right, FIFO wasn't meant to be used in enableMBInterrupt(). I will have to set a limiter based on MAXMB size so people would be forced to use enableFIFOInterrupt() instead
  16. Replies
    359
    Views
    24,940

    are you looping the busses? do you have...

    are you looping the busses? do you have termination?
  17. Replies
    359
    Views
    24,940

    the old flexcan library or the MCP library could...

    the old flexcan library or the MCP library could be emulated with a dummy class that will forward their controls over to the latest flexcan driver. i dodn't say i'd write a canopen stack thats an...
  18. when i get this error: "warning: 'val' may be...

    when i get this error:
    "warning: 'val' may be used uninitialized in this function"

    i formed a habit of setting the variable to 0 when creating it
    int val = 0;

    the compiler just doesn't like:...
  19. Replies
    359
    Views
    24,940

    I havn't messed with CANopen so at the moment I...

    I havn't messed with CANopen so at the moment I couldn't give you an answer. If there is a library that uses it and it's working on teensy (most likely with old flexcan library), I may try to port it...
  20. i've ordered from the states couple times over...

    i've ordered from the states couple times over the past few months. the delivery takes about a month from USA to Canada. The delivery companies have more load now than they used to during christmas...
  21. Replies
    359
    Views
    24,940

    better to have it hard wired than in code, pins...

    better to have it hard wired than in code, pins go hi impedance when the MCU is disconnected, rebooted, or reprogrammed. If a state needs to be enforced when the MCU is unavailable, a resistor is...
  22. i've had teensy 3.5 in my old car for years...

    i've had teensy 3.5 in my old car for years throughout winter ice and summer heat on canbus running 24/7... it is pretty stable, but you could always run some tests with a furnace and a freezer if...
  23. oh no, not division :P try >> 1 shift instead...

    oh no, not division :P

    try >> 1 shift instead of / 2

    sorry trying to stay on 'topic' of performance :D
  24. const uint8_t adc_pins[10] = {A0, A1, A2, A3, A4,...

    const uint8_t adc_pins[10] = {A0, A1, A2, A3, A4, A5, A6, A7, A8, A9};
  25. Replies
    11
    Views
    710

    if you dont set it, it is unused, just comment it...

    if you dont set it, it is unused, just comment it out. Only valid watchdog pins would be set (provided you put in a matching pin), invalid ones or not set wont touch any pins
  26. Replies
    11
    Views
    710

    the pin is used to drive the output should the...

    the pin is used to drive the output should the watchdog be triggered. this allows the watchdog to reset an external board
  27. Replies
    4
    Views
    253

    you have a couple options, 1) serialEvents...

    you have a couple options,

    1) serialEvents function that fires from yield() whenever serial data appears

    2) modify the core's serial buffer, default 64 bytes, but it restores after a reinstall...
  28. you could always go into the library source and...

    you could always go into the library source and change the teensy's #ifdef to something other than what teensy detects as, so it wouldn't use the onboard controller or occupy resources, and it should...
  29. normally pin 10 is commonly used to be CS, but...

    normally pin 10 is commonly used to be CS, but you can use any pin actually.
  30. hooking it up to teensy's SPI is no different...

    hooking it up to teensy's SPI is no different than hooking it to an arduino. But you have to find a working library for that chip, many versions can be found on github. The one built into Teensy has...
  31. Replies
    359
    Views
    24,940

    I put the previous flexcan in a branch of the...

    I put the previous flexcan in a branch of the repo "before-TX-interrupts"

    Update7 has been applied to "master" branch, so no need to patch it anymore.
  32. Replies
    39
    Views
    1,762

    Using 4.0 in automotive environment it runs 24/7...

    Using 4.0 in automotive environment it runs 24/7 on CAN without issues, cabin temperatures here now with summer reached high 70's celcius, no heatsink on T4, enclosed in an atmega2560 enclosure box...
  33. Replies
    359
    Views
    24,940

    the github copy will always be latest, except the...

    the github copy will always be latest, except the patch which is in testing phase on this thread for stability since it introduced transmit interrupt transfers and also able to function directly with...
  34. Replies
    359
    Views
    24,940

    try to use the github repo with this update7.zip...

    try to use the github repo with this update7.zip patch:

    https://forum.pjrc.com/threads/56035-FlexCAN_T4-FlexCAN-for-Teensy-4?p=241861&viewfull=1#post241861
  35. Replies
    359
    Views
    24,940

    Your code I am running right now and it IS...

    Your code I am running right now and it IS running perfect AS IS with min 0x100 -> 0x108 max:



    Interrupted ->MB 99 OVERRUN: 0 LEN: 8 EXT: 0 TS: 24977 ID: 100 Buffer: 1 2 2 2 2 2 2 2
    ...
  36. Replies
    359
    Views
    24,940

    0xFE is less than 0x100, why do you expect it to...

    0xFE is less than 0x100, why do you expect it to pass the filter?

    The filter (hardware) is doing exactly what it supposed to. The reason why your getting some frames above 0x108 (0x10B) is due to...
  37. Replies
    359
    Views
    24,940

    Yes they should work, they're the ones used on...

    Yes they should work, they're the ones used on skpang triple CAN board for T4
  38. Replies
    359
    Views
    24,940

    they can only transmit once and retry if they...

    they can only transmit once and retry if they dont receive ACK. only your code can cause multiple sends, but in hardware, mailbox will send once only even if it retries, it stops when an ACK is...
  39. Replies
    359
    Views
    24,940

    looks like you found a flexcan bug :P should...

    looks like you found a flexcan bug :P should report that on NXP's forums
  40. Replies
    442
    Views
    97,255

    i noticed it intermittent locking up here as well...

    i noticed it intermittent locking up here as well while working on my library, it turns out if i don't include threads.delay(1) OR threads.yield(), it will intermittant lock up, most of the time. I...
  41. Thread: CAN bus write

    by tonton81
    Replies
    24
    Views
    415

    the pins won't communicate if flexcan went into...

    the pins won't communicate if flexcan went into error passive state, it practically sits dormant till another node on the bus starts talking. this happens when it's trying to transmit and not getting...
  42. Replies
    359
    Views
    24,940

    I wouldn't be surprised if it's a hardware bug...

    I wouldn't be surprised if it's a hardware bug since CAN peripherals on same chip behave differently, considering they're running the exact same legacy code, wanna try the github copy if you have...
  43. Replies
    359
    Views
    24,940

    Receiver: #include ...

    Receiver:


    #include <FlexCAN_T4.h>
    FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_64> Can0;

    void setup(void) {
    Serial.begin(115200); delay(400);
    pinMode(6, OUTPUT); digitalWrite(6, LOW); /*...
  44. Replies
    359
    Views
    24,940

    yes both nodes update7, CAN3, using PJRC breakout...

    yes both nodes update7, CAN3, using PJRC breakout board
  45. Replies
    15
    Views
    1,060

    Forum only update currently, teensythreads...

    Forum only update currently, teensythreads support for MCP23S17, allows shared SPI bus with a library mutex pointer passed in by a reference mutex from caller (setMutex()).
    Not specifying setMutex...
  46. Replies
    359
    Views
    24,940

    msadie, I plugged the code back in, your sketch:...

    msadie, I plugged the code back in, your sketch:


    #include <FlexCAN_T4.h>
    #include <elapsedMillis.h>

    FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_128> LCAN;
    elapsedMillis tsk1000msCounter;...
  47. Replies
    359
    Views
    24,940

    you can keep a volatile flag set to 1 every time...

    you can keep a volatile flag set to 1 every time a frame comes in from callback, then have a volatile millis() counter do a timeout in loop if it is not updated from same callback. this would then...
  48. Replies
    359
    Views
    24,940

    2016 civic touring sedan. they are full and...

    2016 civic touring sedan. they are full and overrun because no callback was made and nothing was removing frames from MB, in your demo. I reflashed the EPS using the comma2 which was done by flashing...
  49. https://github.com/tonton81/Circular_Buffer ...

    https://github.com/tonton81/Circular_Buffer

    you can use this to setup as many buffers as you like, but they must be a power of 2, so if you want 10 you'll need to use 16 instead. you can then...
  50. Replies
    359
    Views
    24,940

    LCAN Setup: FIFO Disabled Mailboxes: MB0...

    LCAN Setup: FIFO Disabled
    Mailboxes:
    MB0 code: RX_FULL

    MB1 code: RX_FULL

    MB2 code: RX_FULL

    MB3 code: RX_OVERRUN
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4