rosmo-robot / Rosmo_ESC

Dual brushless motor ESC in #M5Stack module format
Other
28 stars 3 forks source link

Support for CAN-Bus #6

Closed uLipe closed 2 years ago

uLipe commented 2 years ago

I see the module uses an overpowered stm32 microcontroller.

Since this is true, what about select a cheaper one like stm32g431, which has CAN and leave this possiblity besides the traditional serial buses, making this module networkable :)

samuk commented 2 years ago

@runger1101001 may have comment here.

Don't forget the existing modules which can be plugged in to add functionality. https://shop.m5stack.com/products/commu-module?variant=16804786896986

runger1101001 commented 2 years ago

Hey, this is a very good comment.

Yes, the MCU is somewhat overpowered. And it is expensive. And it is big. But, we were trying to create a prototype quickly, and it was available right now (only 20pieces) and so I ordered it and have it.

The final design should be optimised to use a different MCU if possible.

But, on the other hand, I would also make the following points:

In terms of functionality:

uLipe commented 2 years ago

All the comments above are reasonable, my point is to see the CAN-Bus as an additional, not a replacement from I2C or SPI.

The main point of CAN is the possibility to have an distributed network with bitrate higher than I2C, would be an option to route the CAN-TX + RX pins to solder pads and advanced users could stack an transceiver board if they have, I think would have some value to make this board "hackable".

The SPI option is great since it would allow to plug the m5 wiznet modules, allowing to make a true networkable, high-speed and maybe a microROS native motion module.

runger1101001 commented 2 years ago

Ok, I checked the pins, and the CAN is currently blocked by BOOT0, which I haven't routed out anywhere though. I'm unsure if it is needed - normally not for either DFU or SWD programming... perhaps a question for the STM forums to be sure, I can't 100% say from the datasheet. There are also BOOT-bits that can be set via the flags, so that could be another option.

Otherwise if BOOT0 is needed it could be used in conjunction with a CAN transceiver that has an EN-pin. Then we could disable CAN until boot-up is completed, and the BOOT0 pin would not be in the way. I'll try to see what can be done here.

The pins for a 2-pin (no flow control) USART connection are available though, so I will route those out still, and then we will have the option of asynchronous serial or RS485 as well.

samuk commented 2 years ago

I think this is a wontfix for now so closing.