网友viphotman问:PIC32MZ0512EFE064 用内部RC UART 波特率不准?

3 replies [最后一篇]
风清扬
风清扬 的头像
Offline
Joined: 2013-05-29

1 本想用外部时钟,可是用MHC生成的代码,程序跑不起来,听人说外部分时钟要用有源的,请证?
2 在Harmony 设置静态串口,115200波特率,可烧录进IC后一测试,用128000才能正确收到;
请问这是什么问题? 怎么样才可设置为115200的波特率?
下面是配置:(蓝牙部分为修改默认的)
/*** DEVCFG0 ***/

#pragma config DEBUG = OFF
#pragma config JTAGEN = OFF
#pragma config ICESEL = ICS_PGx1
#pragma config TRCEN = OFF
#pragma config BOOTISA = MIPS32
#pragma config FECCCON = OFF_UNLOCKED
#pragma config FSLEEP = OFF
#pragma config DBGPER = PG_ALL
#pragma config SMCLR = MCLR_NORM
#pragma config SOSCGAIN = GAIN_2X
#pragma config SOSCBOOST = ON
#pragma config POSCGAIN = GAIN_2X
#pragma config POSCBOOST = ON
#pragma config EJTAGBEN = NORMAL
#pragma config CP = OFF

/*** DEVCFG1 ***/

#pragma config FNOSC = FRCDIV
#pragma config DMTINTV = WIN_127_128
#pragma config FSOSCEN = OFF
#pragma config IESO = OFF
#pragma config POSCMOD = HS
#pragma config OSCIOFNC = OFF
#pragma config FCKSM = CSDCMD
#pragma config WDTPS = PS1048576
#pragma config WDTSPGM = STOP
#pragma config FWDTEN = OFF
#pragma config WINDIS = NORMAL
#pragma config FWDTWINSZ = WINSZ_25
#pragma config DMTCNT = DMT31
#pragma config FDMTEN = OFF

/*** DEVCFG2 ***/

#pragma config FPLLIDIV = DIV_1
#pragma config FPLLRNG = RANGE_8_16_MHZ
#pragma config FPLLICLK = PLL_POSC
#pragma config FPLLMULT = MUL_33
#pragma config FPLLODIV = DIV_2
#pragma config UPLLFSEL = FREQ_12MHZ

/*** DEVCFG3 ***/

#pragma config USERID = 0xffff
#pragma config FMIIEN = OFF
#pragma config FETHIO = OFF
#pragma config PGL1WAY = OFF
#pragma config PMDL1WAY = OFF
#pragma config IOL1WAY = ON
#pragma config FUSBIDIO = OFF

/*** BF1SEQ0 ***/

#pragma config TSEQ = 0xffff
#pragma config CSEQ = 0xffff
//

Lee_
Lee_ 的头像
Offline
Joined: 2016-03-15
网友viphotman问:PIC32MZ0512EFE064 用内部RC UART 波特率不准?

网友fpga答:
1,可以用外部有源晶振,也可以用外部无源晶振,只要配置位做好相应设置。
2,内部RC频率误差比较大一些,但是波特率计算肯定还是按理论值来的。这样就会造成波特率不准,发生UART通信误码。

Lee_
Lee_ 的头像
Offline
Joined: 2016-03-15
网友viphotman问:PIC32MZ0512EFE064 用内部RC UART 波特率不准?

网友fb321答:
看勘误表,外部必须有源,写的很清楚,要不可能有问题

Lee_
Lee_ 的头像
Offline
Joined: 2016-03-15
网友viphotman问:PIC32MZ0512EFE064 用内部RC UART 波特率不准?

网友fpga答:噢,谢谢提醒。是芯片的问题,目前的版本不能用无源的,要等后续版本修复这个bug

--电子创新网--
粤ICP备12070055号