Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • tonton81's Avatar
    Today, 03:49 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    yes' correct. well they receive, you need to put something to transmit so the other teensy can see it. CAN_message_t msg; msg.id = 0x123; Can0.write(msg);
    13 replies | 926 view(s)
  • tonton81's Avatar
    Today, 02:46 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    you need to use FlexCAN_T4 constructor, not FlexCAN_T4FD, and use CAN1 instead of CAN3 Also, it's good to run one of the FlexCAN_T4 demos to confirm your connections are good before working on TeensyCAN as it relies...
    13 replies | 926 view(s)
  • tonton81's Avatar
    Today, 02:36 AM
    I reverted the interrupt transmits as it wasn't stable compared to the loop, and made all transmits not able to occupy a mailbox into the TX queue, not just sequential ones. Loopback mode and wake up mode have been kept...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-20-2020, 04:56 AM
    yes this is why these are tests for new update later on, thats why I didn't want to touch the repo, I'm a bit busy this week but I'll try to work on it more
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-19-2020, 04:19 AM
    only reason i moved it was because something was throwing off between sequential or remote frames, but that may have been fixed somewhere else or that line was necessary, Im testing 3 types to make sure itll work. so...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-19-2020, 03:32 AM
    thats weird, I just left the house and it was working using the 2 sketches posted, ill check it again when i get home from work
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-19-2020, 02:55 AM
    EDIT, update, can you try this? Seems to work now for sequential and non sequential with no events() in loop(). As for remote frames they seem to be causing their own problem in sequential, so those ones i force to any...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-19-2020, 01:28 AM
    lack of traffic you must use events(), it'll receive one and dequeue one or more transmits. without events() the transmits only happen whenever the ISR is firing, like from receptions. otherwise you need to include...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-18-2020, 02:19 AM
    RFP30N06 Logic level mosfets
    3 replies | 92 view(s)
  • tonton81's Avatar
    05-17-2020, 09:18 PM
    Added your code correction, except rather than adding a line I moved: txBuffer.pop_front(); /* clear on write */ code = 0; /* MSADIE - clear code before configuring for new tx frame */ // deleted ...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-17-2020, 06:44 PM
    The interrupt needs to be enforced to be on even if the user hasn't implemented it, otherwise the transmits won't fire from the ISR, and it would break remote frame capability in the ISR since flexcan switches the MB to...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-17-2020, 04:52 AM
    Just added wake up on traffic support. You can call: asm(" wfi"); in your code to goto sleep. The loop() will stop scrolling after shorting out the CAN lines when the wfi enters sleep. Removing the short on the CAN...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-17-2020, 03:58 AM
    thanks, I was worried about the weight at first on the glass desk, but the back and front legs line up easily on the cross bars under holding the glass, so no pressure on the glass itself, the width is just perfect for...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-17-2020, 03:27 AM
    Well finally got my monitor today, first time I ordered one online after having a dead one for couple months! Fits perfect on the desk lol....... Anyways, I started working on flexcan code, I will post test...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-08-2020, 10:46 PM
    You can't set a signed value to a array of unsigned bytes. What you want to do is cast a signed byte to an unsigned byte to the array then at other end you cast back the unsigned byte as a int8_t to get it back
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-07-2020, 05:29 PM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    The CAN data is bytes only, you will need to handle the data in the array, splitting up the floats to bytes and back at other end. You could always use the PacketID of the data to identify which frames are identified...
    13 replies | 926 view(s)
  • tonton81's Avatar
    05-06-2020, 11:26 PM
    I managed to work on a 4D library that is able to also retrieve live values from LCD's objects, without needing to code in callback. It also doesn't go out of sync either.
    26 replies | 4871 view(s)
  • tonton81's Avatar
    05-06-2020, 10:46 PM
    Supposedly it can wake itself up, I havn't played in that low power field yet, but like I said on cars pins 6 and 14 are the high speed network thats only running when ignition is on, body controller network goes to...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-06-2020, 05:34 PM
    Can0.setRX() without value reinits the pin to default location Theoretically the CAN supposed to self wake without user intervention Dont rerun the constructor. These are compile time objects, it wont be dynamically...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-06-2020, 03:52 PM
    More info:
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-06-2020, 03:48 PM
    The WAKMSK bit is already set in the MCR register. It should already work just check the reference manual. Not sure if this applies to this scenario, or if flexcan refers to ANY frame for wakeup, but when a car shuts...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    05-06-2020, 01:49 PM
    Are you using pins 6 & 14 of the OBD port with proper bitrate selected? What library are you running? What transceiver are you using? How is your wiring setup diagram?
    1 replies | 71 view(s)
  • tonton81's Avatar
    04-29-2020, 01:47 PM
    That data shows that flexcan is in process of transmitting in hardware, and not receiving ACK from network, so that leaves 2 only possibilities: Baudrate calculation (which i doubt, since you are receiving) and...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-29-2020, 04:36 AM
    msadie is correct, if you start seeing the transmit buffers fill but not actually transfer, yet reception works, there is an issue with the transceiver. I have yet no evidence to suspect any software in play here...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-28-2020, 03:07 PM
    My tests are ran off the pjrc and skpang breakout boards, CAN1 is connected to BCAN of vehicle at 125kbps and CAN2 is connected to FCAN of vehicle at 500kbps. Did you check if mailboxStatus() displays TX info pending on...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-26-2020, 08:28 PM
    I reloaded the github release onto my car's T4 to make sure it was the latest loaded, and it's still transmitting fine on the bus. I didn't like the faint chirp of the beeper in the back so when arming the car i send...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-26-2020, 06:01 PM
    Maybe try simple transmitting code in addition from a receiving sketch to check if their are transfers, if you still cant see any transmits, try printing mailboxStatus() after awhile to see if the transmit mailboxes are...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-26-2020, 11:27 AM
    Use a receive demo to make sure your receiving traffic, to make sure transceiver works before transmitting, I was referring to the standby pin on transceiver, if its not held low the traffic may not flow
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-26-2020, 10:35 AM
    Is your Rs pin tied low on the transceiver? When you say output, do you see any data reception on the bus to confirm your seeing the stream? What pins are you using on T4 for the transceiver? I don't see any...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-24-2020, 06:01 AM
    Thats because pinMode reconfigures the pin to gpio (not serial). You can modify the pin register for pullup by enabling the bit but leaving other ones intact, then it will work :)
    5 replies | 116 view(s)
  • tonton81's Avatar
    04-16-2020, 05:45 AM
    The first mailbox found, iflag or not is irrelevant, as long as it is seen as a TX mailbox. If its state is TX_INACTIVE, only then will queue populate it. The iflag wont be set on the initial transfer, we clear the...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-16-2020, 05:01 AM
    Events() only queues sequentials. Normal writes are sent if mailboxes are available. However, we will handle interrupted TX differently. All seq and normal writes are immediately queued. Once the ISR fires, mailboxes...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-16-2020, 04:00 AM
    Ahh but the queue library is FIFO/LIFO, plus it also has a feature to pull in-between queues, although thats something I wouldn't touch while mixing loop() with ISR. I could however put normal writes at end of queue and...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-14-2020, 04:04 AM
    Sounds good so if we were to be bursting frames you recommend we let the ISR handle it via an interrupt enabled TX mailbox, and have regular writes use other mailboxes? Or just have sequential transfers in ISR? or both?...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-13-2020, 11:05 PM
    I believe you are transmitting too fast causing the transmit errors rising past 128. Check the ESR1 and ECR registers in the datasheet. To me it looks like you are receiving and sending frames, if this occurs (TXing)...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-08-2020, 06:41 AM
    This may be better to check ID and datafields: #include <FlexCAN_T4.h> FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_16> Can0; void setup(void) { Serial.begin(115200); delay(400); pinMode(6, OUTPUT);...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-08-2020, 06:30 AM
    I am using this code between 2 T4's using CAN3 in legacy mode, both on PJRC boards. I output the millisec between each frame and I just change the rates of the other T4 sender If I send frames at 200ms intervals from...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-07-2020, 11:25 PM
    Thank you I will look into this further this week
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-06-2020, 05:22 PM
    Can you copy your callback but rename the new one to "ext_output1" And disable events() in loop Let me know results
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-06-2020, 03:54 PM
    That doesn't make sense. When I decrypted my door locks, heated seats, and climate controls, the bits in the frame was toggled immediately with live screen refreshes, I was able to see it toggle as I tapped the locks or...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-04-2020, 09:42 PM
    A weak blank subcall function called from yield() could be implemented to retain core configuration. run_from_yield() :) It can be teensy specific without breaking backward compatibility with arduino, and work...
    4 replies | 348 view(s)
  • tonton81's Avatar
    04-04-2020, 04:40 AM
    It's probably timing characteristics of the tranceivers. Never had to dwelve into that field using stock settings. However, in CANFD, some bitrates in the calculations are able to modify the transceiver timings. ...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-04-2020, 03:42 AM
    If you are suggestion running transmits in an interrupt it is possible, but the ISR handler would need to handle that whenever a transmit interrupt occurs. Yes this is possible but at the same time your still blasting...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-03-2020, 11:13 PM
    By doing this your toggling the transmit mailbox so it may or not may work during transmit and still have issues. These symptoms are not seen with proper transmitters, or with toggling the abort feature. That errata has...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-01-2020, 06:48 AM
    Ive heard also some transceivers cause lockup issues on the bus. But in all honestly if there was an issue with transmitting then TeensyCAN wouldn't be working as I've tested it with 1024 and 2048 byte array transfers...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    04-01-2020, 04:11 AM
    Unfortunately the first master byte gets whatever is in the slave pushr register. So if you change it in the ISR it's too late, thats for the next transfer. You should use while active() because this keeps your loop...
    5 replies | 741 view(s)
  • tonton81's Avatar
    03-31-2020, 11:00 PM
    "i" should be declared volatile uint8_t (your sharing it between the loop() and an ISR), but as for SPI, the last byte set in the slave is the one transfered back to master when master writes to slave. Slave has to set...
    5 replies | 741 view(s)
  • tonton81's Avatar
    03-31-2020, 08:20 AM
    As long as they release the slave output line to floating they can all work on the same SPI bus. If any of the chips cannot tri-state when deasserted, you need to put in a tri-state buffer on those chips.
    4 replies | 227 view(s)
  • tonton81's Avatar
    03-31-2020, 03:50 AM
    Have you tried setting setClock to 60MHz? Thats what I am using in my vehicle at 500kbps The background handler works because it is direct, no filter, to all receptions, without using the queue. Perhaps the bus is...
    256 replies | 17436 view(s)
  • tonton81's Avatar
    03-30-2020, 12:05 PM
    There are 2x CAN2.0 and an extra one which can be either CAN2.0 or CANFD. So you can have 3x CAN2.0 for CAN1,CAN2,CAN3 Or you can have 2x CAN2.0 for CAN1,CAN2 and CANFD for CAN3 CAN3 also has DMA support for...
    3 replies | 238 view(s)
  • tonton81's Avatar
    03-28-2020, 07:51 AM
    Also note that editing the core buffer size removes portability of your code on different platforms, and upgrading teensyduino returns it to stock value of 64 so you'd have to edit again after an update. Teensy is...
    10 replies | 318 view(s)
  • tonton81's Avatar
    03-28-2020, 06:51 AM
    You also have to make sure the other teensy (which is another detail you are using 2 teensy's, not mentioned earlier...) has no code blocking the reads of the Serial1 buffer which you should be handling there. Even if...
    10 replies | 318 view(s)
  • tonton81's Avatar
    03-28-2020, 05:20 AM
    You talk about an issue with sending out, then lead on to say you have an issue receiving. Theres 2 things we need to deal with and without knowing your expectations or code example it's hard to say well it could be...
    10 replies | 318 view(s)
  • tonton81's Avatar
    03-27-2020, 04:08 AM
    For LC, it has nothing to do with the design. In master mode it's properly fit. It's just the way NXP designed the chip itself In master mode: MISO == MISO MOSI == MOSI In slave mode: MISO == MOSI MOSI == MISO
    1848 replies | 139284 view(s)
  • tonton81's Avatar
    03-27-2020, 03:39 AM
    There is an exception with LC in slave mode, it is the opposite when connected to a T3/T4. LC in slave mode, MOSI is MISO and MISO is MOSI. Basically they reversed it in slave mode.
    1848 replies | 139284 view(s)
  • tonton81's Avatar
    03-26-2020, 10:57 PM
    I am curious, could this be relevant to doing multiple SPI accesses while toggling the CS concurrently (back to back) within the same transaction, causes data collission/corruption of some sort as experienced in my...
    18 replies | 369 view(s)
No More Results
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
3,311
Posts Per Day
2.64
Last Post
TeensyCAN Today 03:49 AM
General Information
Last Activity
Today 03:49 AM
Join Date
12-18-2016