[gnea/grbl-Mega Issue#46] change USART

未分类 bolang 3个月前 (10-15) 31次浏览

Issue #46 | 状态: 已关闭 | 作者: WD24 | 创建时间: 2017-11-14


Is it possible to use a different USART on the Arduino mega?

I tried to change the USART in cpu_map.h from:
#define SERIALRX USART0RX_vect
#define SERIALUDRE USART0UDRE_vect

to

#define SERIALRX USART1RX_vect
#define SERIALUDRE USART1UDRE_vect

and then connect FTDI232 serial programmer but it out puts nothing.
Basically the Serial chip on my arduino mega is broken.
is it possible to change to a differnet serial port?


评论 (5)

#1 – chamnit 于 2017-11-14

Yes. You’ll need to update the macros in serial.c as well. Grbl isn’t fully configurable in the cpu map file.


#2 – Diamus 于 2018-02-08

I am trying to get a makeblock megapi to use USART3 in order connect a bluetooth module to the wireless port on the megapi. I have tried to change the serial.c to reference all the registers related to USART3 but still cannot communicate. I have reached the end of my skills after several hours of research and trying. I don’t like it but I am at a loss and asking for help.

I have attached the serial.c and cpu_map.h files:

serial.txt


#3 – Diamus 于 2018-02-13

Found the problem. I missed changing one register. Corrected it and all is well.


#4 – WD24 于 2018-02-23

Which register did you miss out?


#5 – Diamus 于 2018-02-24

Line 103 of serial.c
was
UCSR0B |= (1 << UDRIE3); should be UCSR3B |= (1 << UDRIE3); Attached is the fully corrected file. serial.c.zip


原始Issue: https://github.com/gnea/grbl-Mega/issues/46

喜欢 (0)