Re: Suggestion for a Can Bus newbie
☼ Best Answerby seyyah 2020/04/08 10:41:17
As pcbbc suggests, this all depends on your application.
But I think this is the help that you are asking for, so;
You should think about how the system will finally operate, what are you measuring,
what is the reason for the messages being sent/received. Urgency? Alarm?
If things need an immediate response, (alarm) this suggests that polling is not a good way, a peripheral needs to
attract attention immediately.
If the system is simply a weather station, where messages can be seconds(minutes?) waiting to be sent, then polling is fine.
As for identifying connected/disconnected peripherals, do a roll call on power up, if things can be connected/disconnected while powered, either periodically do a roll call (send address, wait for 'Present sir'), or first job of a peripheral is to get an acknowledge from the master (or other nodes).
Spend some time thinking about the end user and how they will expect to be able to use the system. Then design 'that'.