I've had mixed results with this level converter circuit driving ws2812, as the low to high transition speed is limited by the 10k pull-up. Or I could have been doing something else wrong, I suppose.
Type: Posts; User: msadie
I've had mixed results with this level converter circuit driving ws2812, as the low to high transition speed is limited by the 10k pull-up. Or I could have been doing something else wrong, I suppose.
Teensyduino doesn't include the latest FlexCAN_T4 library, so make sure you get it from here: https://github.com/tonton81/FlexCAN_T4
When enableInterrupts is set in setup, events() should be removed...
Glad you got it working.
I had been experiencing related issues prior to the FlexCAN_T4 commit on June 20 (AKA Update7), so my money is on that.
Tony - that commit barely missed inclusion into...
Yep, that's all.
Regarding the RX mailboxes: both due and flexcan use 7 RX mailboxes by default. If your message handling is fast enough, only 1 RX mailbox will be used at a time, and nothing can get out of order. If...
According to the due-can readme, the default uses 1 tx mailbox. If it's occupied with a frame pending transmission when you try to send a new frame, the new frame will be queued. When the pending...
Is it possible the symptoms could be caused by frames being forwarded out of order, rather than lost? Does the display's protocol split data across frames then reconstruct it? Does it have a...
https://github.com/luni64/VisualTeensy
Make sure both transceivers have their "S" pin pulled low. Also, just to be certain, you are supplying the transceivers with 5v?
I haven't had a chance to read through your code yet, but here's a couple common sources of trouble:
Do you have the bus properly terminated at both ends with 120 ohm resistor from CANH to CANL?...
Check out this linked doc on how to connect TX to RX and still have proper ACK function.
https://forum.pjrc.com/threads/56035-FlexCAN_T4-FlexCAN-for-Teensy-4?p=254406#post254406
Two further aspects must be considered:
1. With can1tx connected to can2rx, can1rx is expecting to see the bus state at all times, as if connected to can1tx.
2. During the ACK slot bit of a...
It doesn't work if you just connect TX to RX. Check out: http://www.mikrocontroller.net/attachment/28831/siemens_AP2921.pdf
T3.6 supports a max bitrate of 1Mbps.
If you are particularly concerned, I'd recommend higher quality header pins. I used Millmax 315 and 364 super low profile headers on a recent project and was quite impressed with how securely they...
Looking at pictures of that board, the "jumper" on the board is probably not meant to be a jumper. More likely its just a 2pin 0.1inch header for connecting to CAN_H/CAN_L. You can connect via this...
Check out this post for a succinct explanation on why that baud rate is gone (and most often is ignored).
https://forum.pjrc.com/threads/57515-Baud-Rate-for-IDE-Serial-Monitor
Serial.begin() belongs in setup().
Per your code, it will only display more if you type "a" in the line at the top of the serial monitor and hit Send.
Can you select Tools -> Port -> COM3 Serial (Teensy 4.1) and try again?
Ive confirmed this behavior on CAN1/CAN2 of a T4.0
Arduino 1.8.13 / Teensyduino 1.53
Change enableMBInterrupt(FIFO) to enableFIFOInterrupt() for both CAN channels. I think you may have found a bug (or at least an issue with the readme, which suggests this exact code).
Also,...
You might also check out TeensyCAN: https://forum.pjrc.com/threads/58242-TeensyCAN
I think the resistor needs to be on the vertical branch to the 3.3v. This would weakly pull-up Rs, and then could be easily pulled low by the T4 digital out. A possible issue I'm not sure about is if...
Interesting. Looks like the imxrt1170 is targeting 3x CAN FD modules and ditching the FlexCAN 2.0, so at least that minor bug mailbox will be resolved.
Github code acts exactly the same as Update7, CAN1 and CAN2 act weird when setMaxMB(10), but CAN3 operates correctly.
OK. I hooked up two T4's using CAN3 with your provided code and everything worked properly.
Next, I changed the sending node to use CAN1 (in code and TX/RX wires) and it is back to unusual...
Could you please also share your receiving node's code, so I can start from your known-good setup and work backwards?
Tony, thanks for checking that. You are using CAN3 and Update7 on both nodes?
OK, had to ask.
You might try adding the following code to the transmitting and receiving node's loop():
void loop() {
// Your existing code here
static uint32_t timeout = millis();
...
Just as a check: on the SN65HVD233DR, are you connecting pin 5 (Loopback disabled) and pin 8 (Rs - highspeed mode) both directly to ground?
After some tests, I'm fairly certain the reason your different results was your test had other bus traffic. If teensy node running the sample code is TX'ing to a bus with only receiving nodes (for...
Is there other traffic on that bus causing the RX full/overrun? Mine was set up on a quiet bus, and if I recall correctly, a RX message caused the "stuck" message to TX. I'll have to try again with...
Unfortunately nothing that exciting at the moment. Just trying to keep some ecu's happy on the wrong vehicle. Does the T4 interface somehow with the openpilot? I had never actually looked closely at...
Just tried with millis() and the result is the same. If I change the above code to "LCAN.setMaxMB(11)", it works fine.
I dont understand
Regarding update7:
If I setup the mailboxes without FIFO and MB9 as last TX, message sending gets weird.
MB setup:
FIFO Disabled
Mailboxes:
MB0 code: RX_EMPTY (Standard Frame)
MB1...
I assumed it would be best to just return the same uint64_t that events returns, for sake of consistency. If someone is using the current library and making use of the returned queue size from...
getQueueSize()?
After lots of reconsideration, I'm now thinking sending the messages by ID priority is more important for this application than forcing them to transmit sequentially. That said, everything seems to...
I'm glad too. Thanks for your efforts! I think the interrupt driven TX resolves the weird lockup issue I was having a while back.
My objective is to be able to replicate the bus activity as...
OK. Update6 seems to be working well so far for a simple gateway program writing to an quiet bus.
I'm a bit concerned with the 1 bit of bus idle between sequential writes from queue. This allows...
I believe I just found the source of the interrupt based instabilities. I think it's due to new interrupts being fired while flexcan_interrupt() is in process (due to a call from events()).
To test...
After more testing of Update4 with the edit above, it still requires LCAN.events() to keep outgoing traffic. It fixes the ISR getting stuck looping, but something else still requires events() to...
When you said try with my code, I thought you meant the code I posted. Using your reduced version of my code, it does work. However, with a serial.print in the flexcan_interrupt() function, it loops...
Not sure what's going on but it only forwards the first message after reboot, regardless of .seq or events().
EDIT: I added blink LED code to the main loop and it seems loop execution is stopping...
Just a disclaimer: I'm not very familiar with the particulars of remote request frames so some of my comments be seem misguided.
I applied update3 to my simplest gateway code, CAN2 (VCAN)...
Wow! That is quite the monitor!
I started looking over your updates and found a small bug in flexcan_interrupt() for TX: The "code" value for TX MB's still contains the previous frame's DLC, which...
I tested your code on my T4 board with TI TCAN330GD transceivers on CAN1 and CAN2. I wired CAN2 to CAN1 and added termination resistors. Everything functioned as intended.
I suggest trying to...
You just need to add the following line. Anytime it is called, it will print the status of all mailboxes to the serial monitor.
myCan.mailboxStatus();
I suggest adding it a couple places:
1....
Micky,
I've confirmed FIFO message reception and standard mailbox transmission for the following transceivers:
TI TCAN330GD
MCP2562-E/SN
Microchip MCP2551-I/SN
TI SN65HVD232D
Out of...
That clarified much of my confusion. I'm almost there, just one more question:
When you say "The first TX mb found in the scan" do you mean the first TX with IFLAG asserted or first MB set as TX?