CAN Bus Protocol Transmitter doesn't work inside time-delay condition....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-24 4:15 AM
When I try to transmit can CAN data it doesn't work inside the time-delay condition... but it works properly without that condition...
Does anyone knows what's the issue?
Regards
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-24 6:30 AM
Do you initialize the tick5 value at loop entry?
Is this in a callback?
Does the tick count advance here?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-24 6:30 AM
Do you initialize the tick5 value at loop entry?
Is this in a callback?
Does the tick count advance here?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-24 6:51 PM
@Community member​
>>Do you initialize the tick5 value at loop entry?
I have initialized it as a global variable
>>Is this in a callback?
No, its in the main while loop
>>Does the tick count advance here?
I'm new to stm32, don't know what your question is....
I just want to send data using CAN BUS at every 200-300ms. But when I try to transmit it in if(HAL_Getick() - tick5 > 200) it doesn't work....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-25 6:36 AM
Is HAL_GetTick() incrementing as each millisecond passes within the loop?
If you send a character to a UART as well, can you see that occur periodically?
Does HAL_CAN_AddTxMessage() return success or failure codes? Should you need to use more than one mailbox?
I understand the goal, just not sure if it's not attempting to send at all, or if the approach here is wrong, or has unexpected modes of failure that you're not addressing or handling.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-25 6:40 AM
>>but it works properly without that condition
show us
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-26 9:18 PM
>>Is HAL_GetTick() incrementing as each millisecond passes within the loop?
yes, its incrementing
>>If you send a character to a UART as well, can you see that occur periodically?
I can't do this, it's a customize development board with no USB-UART TTL and no other free gpio pins, I will check the schematic again
>>Does HAL_CAN_AddTxMessage() return success or failure codes?
it return success code, but when I checked on oscilloscope, there is no signal...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-26 9:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-26 11:46 PM
Could you let me know, how to transmit data using CAN Protocol after a time period. I just want to transmit data after a time period...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 12:57 AM
You can wait a time period, say 200ms, simply with HAL_Delay(200) in the while loop after sending each message.
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 8:31 PM
without HAL_Delay() ???
