1

I am designing a UI PCB which has an MCU which will interface with a main system controller (MSC) on a separate PCB. The UI PCB provides an initial power up to the MSC which then boots up its onboard PSU and everything else. Additionally it should read messages from the main system controller to provide on the UI (LED's, display etc.). Finally it has buttons to power on, or reset the main system controller.

The UI PCB communicates with the MSC using CAN bus. I was just wondering if I would need additional IO's between the two PCBs? Can I send the data from the buttons on the UI board (like if it was being used as a state machine) as a message on CAN bus? Or would using a simple GPIO make more sense for this?

Transistor
  • 168,990
  • 12
  • 186
  • 385
Hasman404
  • 717
  • 6
  • 15
  • Please [edit] to explain what a PCBA is. – Transistor Apr 12 '21 at 08:18
  • Assembled pcb's. I've just replaced it with pcb. – Hasman404 Apr 12 '21 at 08:27
  • surely you should ask the software people who are probably more familiar with the capabilities of the CAN bus – user253751 Apr 12 '21 at 08:48
  • 4
    @Transistor, PCBA is a standard industry term for PCB Assembly, been in use for many decades – TonyM Apr 12 '21 at 08:58
  • @user253751, understanding CAN isn't a more-hardware or more-software thing, it's a simple enough bus. Here, the OP's asking about electronic circuit design, not software design. – TonyM Apr 12 '21 at 11:14
  • "CAN or GPIO" Depends on distance, voltage, current etc. Generally, CAN bus is better and more flexible, but adds a bit of BoM cost plus MCU support. It's also a good thing to de-bounce buttons locally. If you mean to drag GPIO over longer distances, it should preferably be current modulation rather than voltage and ideally you'd use 24V rather than 5V or 3V3. – Lundin Apr 13 '21 at 06:43
  • @TonyM Well, CAN does mean that you need a local MCU. And writing drivers for it isn't necessarily trivial either, some controllers are quite intricate. – Lundin Apr 13 '21 at 06:45
  • @Lundin, I design for CAN a lot in different environments so do I understand it well. But that's not the point I made above, though, which referred to the OP's question rather than an abstract view of CAN. – TonyM Apr 13 '21 at 07:17

1 Answers1

1

Can I send the data from the buttons on the UI board (like if it was being used as a state machine) as a message on CAN bus?

Yes, you can.

Or would using a simple GPIO make more sense for this?

I might make more sense if the CAN bus transmission rate was limited to some particularly slow speed and potentially gave the impression to the user (as in UI) that the interface was a little bit sluggish. If not, go for CAN bus for everything (or, generally, whatever serial data link is being used).

If you have spare IO on the UI and you can easily route it to your MSC, then why not route it (just in case you do need future expandability).

Andy aka
  • 434,556
  • 28
  • 351
  • 777
  • 2
    The lowest standardized CAN baudrate is 10kbps. If you pick 1 byte payload (8 buttons) you get 56 bits package (ignoring stuffing). Then it takes 56ms to transfer such a package. Humans start to notice delays somewhere around 150ms, so there would still be a huge margin even if you have some ~20ms debouncing. – Lundin Apr 13 '21 at 06:42