You are here

UART for NRF51822 on "old" nrf pins ?

7 posts / 0 new
Last post
CTSchorsch
Offline
Last seen: 4 months 2 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101
UART for NRF51822 on "old" nrf pins ?

Hi Benjamin,

first thanks for your great work, i really like your project.

one (more) question from my side: do you think it is possible to connect a NRF51822 modul on the pins where you connect th nrf24l01 in your vesc 6 schematic ?

so the normal uart will be free for debug and other use

Thanks

Georg

 

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

It is possible, that is actually done on the 75/300 already and the next revision of the V6. I added support for that in the firmware a while ago.

CTSchorsch
Offline
Last seen: 4 months 2 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101

Hi Benjamin,

thanks for your answer. This sounds good. Can you give me a hint, how to activate it ? I'm still not good in understanding the whole code. I'm more the hardware guy :)

Georg

CTSchorsch
Offline
Last seen: 4 months 2 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101

i just tried a copy/paste approach and added so following defines to my hw conf, but it is not working

// Permanent UART Peripheral (for NRF51)

#define HW_UART_P_BAUD          115200

#define HW_UART_P_DEV           SD4

#define HW_UART_P_GPIO_AF       GPIO_AF_UART4

#define HW_UART_P_TX_PORT       GPIOB

#define HW_UART_P_TX_PIN        3

#define HW_UART_P_RX_PORT       GPIOB

#define HW_UART_P_RX_PIN        4

#endif

I saw that most of the hardware use GPIOC for the permanent uart, but this ports are used for the DRV on HW6. Is it possible to start a uart on every GPIO ?

 

CTSchorsch
Offline
Last seen: 4 months 2 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101

okay, found out myself :)

my pins has no UART as alternate pin function

i use now pins from the hall-sensor connector. i have a sensorless motor and this pins are free

thanks

Georg

hl0dk0
Offline
Last seen: 1 year 4 weeks ago
Joined: 2022-06-21 07:14
Posts: 2

I saw your post and I want to implement same solution.

Did you manage to make it work?

Is there any more code to change?

What pins did you use?

hl0dk0
Offline
Last seen: 1 year 4 weeks ago
Joined: 2022-06-21 07:14
Posts: 2

I fugured it out.

had to put:

// Permanent UART Peripheral (for NRF51)
#define HW_UART_P_BAUD			115200
#define HW_UART_P_DEV			SD6
#define HW_UART_P_GPIO_AF		GPIO_AF_USART6
#define HW_UART_P_TX_PORT		GPIOC
#define HW_UART_P_TX_PIN		6
#define HW_UART_P_RX_PORT		GPIOC
#define HW_UART_P_RX_PIN		7

into hw_XXX.h

and change this two.

// Hall/encoder pins
#define HW_HALL_ENC_GPIO1		GPIOC
//#define HW_HALL_ENC_PIN1		6
#define HW_HALL_ENC_PIN1		10
#define HW_HALL_ENC_GPIO2		GPIOC
//#define HW_HALL_ENC_PIN2		7
#define HW_HALL_ENC_PIN2		11

than I just had to work out which HAL input is RX an which is TX.

IT WORKS laugh yes