You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the code is loaded into the MCU and transmission begins, such code
CAN.beginPacket(0x12);
CAN.write('h');
CAN.write('e');
CAN.write('l');
CAN.write('l');
CAN.write('o');
CAN.endPacket();
Overflows the frame, which transmits only 8 bytes of data.
The signal analyzer sees the frame, but it fails.
I interpreted this as the frame size being exceeded.
Replacing the code with this
const char* message = "Hello, World!"; // Message with a length of 13 bytes
size_t messageLength = strlen(message); // Get the length of the message
size_t offset = 0; // Initialize offset to keep track of the current position
while (offset < messageLength) { // Continue until all data is sent
CAN.beginPacket(0x12); // Begin a packet with identifier 0x12
// Write up to 8 bytes of data
for (int i = 0; i < 8 && (offset + i) < messageLength; ++i) {
CAN.write(message[offset + i]); // Write each byte from the message
}
CAN.endPacket(); // End the packet
offset += 8; // Increment offset by 8 to move to the next chunk of data
}
I get a line with the correct checksum and NAK at the end.
Without the jumper, the data on the bus was always ERROR, perhaps because I only have one board so far, and there is no second one, and only the signal analyzer takes data.
When I installed the jumper J1, the data immediately appeared.
I have only just begun to understand the CAN bus and many things remain mysteries.
The text was updated successfully, but these errors were encountered:
Good day @sandeepmistry 🙂
I take this module, I replaced
CAN
transceiver microcircuit withSN65HVD230
Now the board is powered by 3
.3 volts
.I connect it via the
SPI
bus to theSTM32
microcontrollerI took this example:
https://github.com/sandeepmistry/arduino-CAN/blob/master/examples/CANSender/CANSender.ino
First, I set the desired
CS pin
Then I set the quartz frequency, I have
8 MHz
on my boardAnd ser
125000 baudRate
When the code is loaded into the
MCU
and transmission begins, such codeThe signal analyzer sees the frame, but it fails.
I interpreted this as the frame size being exceeded.
Replacing the code with this
I get a line with the correct checksum and
NAK
at the end.Without the jumper, the data on the bus was always
ERROR
, perhaps because I only have one board so far, and there is no second one, and only the signal analyzer takes data.When I installed the jumper
J1
, the data immediately appeared.I have only just begun to understand the
CAN
bus and many things remain mysteries.The text was updated successfully, but these errors were encountered: