Teensy 4.0 Sleep with CAN wakeup

So much for proof read several times lol, I added the missing loop code in the previous post.

I would say your fix is working, I’m not sure why I have to have more than one CAN device on the bus for that bus to wake up, seems a bit odd but in my vehicle each bus will have multiple modules so it’s not a big deal but could still be a bug in the code or even in the flexCAN code.
 
I do not have a separate pin for wake up, each CAN RX pin is setup to be the wake up source.
In other words, hardware wise, what's needed to sleep the Teensy and wake the Teensy over CAN is the following if we only use one network.
Where STB is an output pin from the Teensy to tell the transciever to go to sleep (HIGH/LOW). The transciever then wakes the Teensy when there's activity on RX because the Teensy interrupt listens for change on that pin. And with those things said the circle closed?

Code:
#define CAN1_STB 7      // Transceiver Standby Pin
#define CAN1_RX 23      // Transceiver RX Pin
 
I’m not sure why I have to have more than one CAN device on the bus for that bus to wake up
Well with only one active node the packet's don't get ACK'd and the single node will eventully fall into passive error mode if it sends packets regularly?
 
In other words, hardware wise, what's needed to sleep the Teensy and wake the Teensy over CAN is the following if we only use one network.
Where STB is an output pin from the Teensy to tell the transciever to go to sleep (HIGH/LOW). The transciever then wakes the Teensy when there's activity on RX because the Teensy interrupt listens for change on that pin. And with those things said the circle closed?

Code:
#define CAN1_STB 7      // Transceiver Standby Pin
#define CAN1_RX 23      // Transceiver RX Pin
Yes that is correct if your only using one CAN module.
Well with only one active node the packet's don't get ACK'd and the single node will eventully fall into passive error mode if it sends packets regularly?
The part I don’t understand is that the teensy interrupt isn’t looking for a valid CAN frame, it’s just looking for a falling edge on the RX pin which it gets many from a single CAN frame but won’t wake unless another module is on the bus also. I have a CAN transmitter that will relentlessly send the same frame till it properly transmits and that can’t wake the teensy unless another module is attached to the network. Doesn’t make any sense to me as it should wake even on frame errors. I think there is still some issues with the snooze library but it’s way beyond my capabilities to fix at my experience level.
 
Yes that is correct if your only using one CAN module.

The part I don’t understand is that the teensy interrupt isn’t looking for a valid CAN frame, it’s just looking for a falling edge on the RX pin which it gets many from a single CAN frame but won’t wake unless another module is on the bus also. I have a CAN transmitter that will relentlessly send the same frame till it properly transmits and that can’t wake the teensy unless another module is attached to the network. Doesn’t make any sense to me as it should wake even on frame errors. I think there is still some issues with the snooze library but it’s way beyond my capabilities to fix at my experience level.
This is a hunch but maybe the strength from one transciever isn't enough. Not enough power? But when two is sending there's more "signal strength".
 
Perhaps the bus isn't terminated properly (120 ohms at each end) if there's only one transceiver attached?
 
Yes that is correct if your only using one CAN module.

The part I don’t understand is that the teensy interrupt isn’t looking for a valid CAN frame, it’s just looking for a falling edge on the RX pin which it gets many from a single CAN frame but won’t wake unless another module is on the bus also. I have a CAN transmitter that will relentlessly send the same frame till it properly transmits and that can’t wake the teensy unless another module is attached to the network. Doesn’t make any sense to me as it should wake even on frame errors. I think there is still some issues with the snooze library but it’s way beyond my capabilities to fix at my experience level.
The components that’s supposed to send the wake up signal is the transciver, as it will pull the RDX pin LOW when it detects a bus wakeup sequence, and that only.
Teensy does not have this capability built into the controller.
Sending a std frame won’t trigger that as far as I know.

But, there seems to be an option to set some bits in the frame to signal the wakeup sequence:
 
Back
Top