charging devices have power profiles for usb-c, a protocol must be communicated to allow switching to higher voltages if supported by the adaptor. power is defaulted to 5v on connection and unless you send the correct...
Tri-state is not a CS issue unless you have both CS' asserted. The issue is at MISO, some chips don't tri-state that line and it fights with the other slave that is ran in parallel. tri-state buffers exist for these...
if you don't use events(), message reception is fired directly to callbacks. I too use CAN button counting for OEM keyfob to control windows and sunroof, obviously you need to count them not in the callback scope only,...
also if a mailbox gets a similar frame in other than it's own in filter mode, an overrun would occur and the frame would be overwritten. example without filters is, if all the mailboxes fill up without reading them,...
mailboxes are like a drop box queue, each one can hold one receive (or transmit) message, the others wait in line to grab the next one. FIFO (rx only) is 6 messages deep, in reception order. Mailboxes can receive frames...
check mailboxStatus(), if all of your TX mailboxes fill up, you have a bad physical connection, miswire, termination issue, worse case scenario, bad transceiver
make sure you have the chip set to normal mode, theres pins that have pullups and pulldowns on that IC and if it's not in normal mode it won't work, @msadie has the same chip as you and claims it works
what does your...
you should feed it in your regular code loop and not a timer, the watchdog has it's own callback should your software freeze up, the callback will be fired so you can do whatever you want there before the hardware...
there could maybe be more micromods in different teensies in future? who knows, but make it specific for the 4.x?
#if defined(ARDUINO_TEENSY_MICROMOD) && defined(__IMXRT1062__)
have you tried different clocks? 500k shouldnt have issues unless the bus has very specific timings, changing the clock will calculate a different timing even though speeds are same. On the FD end there are several...
The alarm one is working as well! I set the alarm for 10 seconds:
#include <Watchdog_t4.h>
#include <Snooze.h>
WDT_T4<WDT1> wdt;
SnoozeUSBSerial usb;
SnoozeTimer timer;
SnoozeAlarm alarm;
I *think* you wan't to pass an object, but in templates the objects are not easily passable to functions. However, thats why a base class exists so FlexCAN_T4 can also do it's tasks in background giving you the ability...
Ok, I had to rush out to work today which is why I said I'll be on this later. I reverted the changes and fixed the library, watchdog is firing at 1second timeout resets if i dont feed it now so thats good, and the 5...
I think the alarm is resetting the T4.0, I am using the timer and it is working correctly with the latest commit to WDT_T4: https://github.com/tonton81/WDT_T4
Teensy 4.0/4.1 is same processor, so it'll work on...
the suspend function enables it on watchdog register but i think the deepsleep has to stop the clock it uses as well. I am not sure what clocks deepsleep turns off, or if the wdt one is still active (aka not suspended)
I believe you should goto a system register, paul posted it somewhere, im not at home. it shows whether it was a POR (full repower or after programming), temperature, or wdt reset. i believe the WDT register also shows...
the array for the message struct is 8 bytes, writing past it causes undefined behaviour. this probably wouldn't have happened if you used CANFD as it's buffer is 64 bytes :)
msg.flags.overrun is useless for...
yeah it could be a non standard bitrate (since you said 500000 worked?)
on the other thread someone else had issue with 95000 not working. when i told him to try 95238, his network functioned correctly after. if you...
constant (if your using only one device on that port, unless you switch between devices i guess) is possible. SPI_MST as example constantly pulses the clock by sending data for 2-way communication between teensies
...
does the loop completely halt? i noticed you're running a non standard baudrate (100000), keep notes that, like on another post someone had issue with 95000 not working, changing the rate a bit helped it work....
by design if no acknowledgement the hardware itself tries to resend, this is what makes canbus reliable for delivery. check for proper termination on the network
what does it show when you ask for can2.mailboxStatus()?
If the transmit mailboxes are full, it means your transceiver or bus is not wired or terminated properly.
second, you are using CAN3 for can2 object, which is...
won't the data be lost when the 4.1 resets? shouldn't persistance be part of eeprom emulation as well? perhaps have the data stored in intervals to flash or SD
for FD you need to use setClock(CLK_60MHz ) (or other clock) if needed to adjust the controller clock as the timings are different for many of it's bitrates. FD mode supports compatible CAN2.0B mode, receptions are...
yes you can wake up devices on the bus. you need to let it goto sleep usually and start logging when you wake it up, you'll see the first frame needed that bursts onto the bus. Thats how I wake up the body controller on...
read the blue
The TJA1051T/3 and TJA1051TK/3 allow for direct interfacing to microcontrollers with supply voltages down to 3 V
7.2.2 Internal biasing of TXD, S and EN input pins Pin TXD has an internal...
just make sure the thread exits the scope, return or not.
you know the thread needs a while loop to remain always running, the moment that while loop exits, the thread exits, and the thread stops as it exits scope. so...
each usb has it's own registey entry in windows. just because 1.... maybe 100 work, and 1 doesn't may or may not be hardware, but it could be a corrupted registry entry for that specific device in windows. Try to...
button chatter, debounce needed. anyways, better to set state to the gpio result (HIGH (1) or LOW(0)) then set digitalwrite the state, that should solve that problem
state = digitalReadFast(interruptPin);
when I added Collin's Object Oriented CAN callbacks to FlexCAN_T4, I also included compiler errors which you would have seen:
#if defined(__MK20DX256__) || defined(__MK64FX512__)
static_assert(_bus == CAN0,...
check your transceiver's operating mode as well as per datasheet. 2 pins are involved. EN should be tied HIGH and S should be tied LOW
also you should be using the /3 chip model for Teensy, not the /E
what pins are you using on teensy? CAN2 uses pins 0 and 1, also confirm first with the fifo interrupt example, it works as is just change the bus to CAN2 in constructor, if that still doesn't work, try to print...
Just updated the library. It now supports:
mySPI.swapPins() --> swaps MISO with MOSI, so you can connect teensies together directly pin-to-pin:
13 13
12 12
11 11
10 10
Hey that is an interesting idea. We could setup the library to also be an SPI bus sniffer. The T4.x is capable of swapping the MISO/MOSI pins so you can log & sniff data going to and from the SPI devices. The outgoing...
As a spy? just don't hookup the return line so it wont try to send anything to it, it should be able to print out what it sees on the spi bus with the callback disabled
SPISlave_T4 has been released!
You may download it at https://github.com/tonton81/SPISlave_T4
An example is supplied as well.
It is based on TSPISlave for Teensy 3.x, except it has an additional feature. Not...
Yes! I got SPIMODE0 working! :D
It turns out that aside from setting the TDR in the ISR with the RDR read, the initial TDR must ALSO be populated initially in setup! So while the ISR keeps setting a new TDR while...
it wont change the bus activity, but it will probably make controller more responsive, you probably wouldn't notice. It's also used for different baudrates that don't reliably work at X MHz since bitrate is calculated...
2 sends before response, i think the motor needs a time gap between commands, not sure. I know for cars if you write too fast they also stop responding for a bit, and car's gap is usually 10ms (not uS) :)
the fact...
not really, does the motor perhaps requires a delay between requests (like car's do?) try to put a small delay between each request. If you wamna know for sure if it's a transmit issue, have another node on the network...
MB99 is virtual, it's actually FIFO, check if your bus is properly terminated?
i dont see your sendStatusxRequest functions so I dont know for that part
there is a FIFO interrupt example that just works on the repo, just make sure you select the right bus in the constructor (CAN1,CAN2,CAN3)
1) masking not needed
2) need interrupt and callback
3) fifo has ordered...
Oh! Isn't this interesting. Another limited feature of SPI slave. Even if the SION bit is set, it will NOT return 1 if the CS pin is HIGH. None of the SPI slave pins register as high or low on GPIO7_DR, however...... as...
Another interesting issue I see with SPI slave mode, I added 8, 16, 32bit data transfer support. Here is whats weird:
LC is sending (SPI.transfer()) 8 bit data over to 8 bit slave mode T4. This works.
LC then sends...
Anyone playing with a non-DMA version, interrupt driven version of SPI Slave? I been working on one and my setup is as simple as this:
#include "SPISlave_T4.h"
SPISlave_T4<&SPI> mySPI;
void setup() {
...