You are here

Second uart?

3 posts / 0 new
Last post
Kubbur
Offline
Last seen: 2 years 10 months ago
Joined: 2019-09-16 19:27
Posts: 1
Second uart?

Is there an second uart that we can somehow access? Would be awesome to be able to control lights and other things through the vesc

Pimousse
Offline
Last seen: 10 months 10 hours ago
VESC Original
Joined: 2017-05-24 12:15
Posts: 101

Not on the current design.

Even if HW wise, that souldn't be that complicated, that means a complete rewrite of the FW as there are not so much free pins + managing UART commands coming from 2 sides.

benjamin
Offline
Last seen: 2 weeks 2 days ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

There is actually a second UART that can be activated permanently in the firmware if the hardware supports it. I added it so that the BLE modules can be active all the time, regardless which app is selected. The second port uses the same data as the first one though, and it might be better to just connect lights to the first UART port. If you write a custom app though you can use the first UART port in any way you want. I hope I have time to make an updated tutorial about that.

 

For controlling lights and other custom things I have started an a bit ambitious project that may or may not finish ever: a virtual machine running on the VESC and an almost-C-compiler built into VESC Tool. Then you can run your own custom code and access most motor control functions and IOs/ADCs in a sandboxed environment on the VESC, which should be much easier than setting up the ARM toolchain and everything. For now I have revived some code from my old compiler construction course and can generate assembly for an easy to implement virtual machine that I came up with. Also, I have a colleague and friend who is doing an alternative approach with running LISP on an MCU, and he is a bit further than me. Maybe running a virtual machine on the VESC is a stupid idea, but we will see if it gets somewhere :-)