Joined: 21 Mar 2007
Posted: 26 July 2017, 13:28 PM Post subject: Generic UART not working above 57600
|Generic targets work great ,,, as long as You keep below ConsoleSpeed of 57600 ... 115200 does not work for my boards , is it a generic target issue or something i have overlooked ?
This affects both the 328P & Mega2560 . . .
Option TargetDevice ATmega2560
Option DeviceParameter clockFrequency 16000000
Option DeviceParameter rtcFrequency 500
Option DeviceParameter rtcScale 1
Option DeviceParameter swUartDivisor 8
Option DeviceParameter swUartMinSpeed 300
Option DeviceParameter swUartMaxSpeed 19200
Option DeviceParameter swUartBaseSpeed 2400
Option DeviceParameter timerSpeed1Divisor 1
Option DeviceParameter timerSpeed2Divisor 8
Option DeviceParameter ZBasicBootloader True
Option ConsoleSpeed 115200 ' 57600 works fine
Option RTC on
Option Signon on
Option TxQueueSize 100
Option RxQueueSize 40
Option Console Com1
Const Led as byte = B.7
Debug.Print "Hello From 2560"
Debug.Print "Hello ."
Call PutPin(Led, 1)
Call PutPin(Led, 0)
Debug.Print "It Really Works :)"
Joined: 03 Sep 2005
Location: Portland, OR
Posted: 10 August 2017, 2:16 AM Post subject: Re: Generic UART not working above 57600
At 16MHz, the available divisors cannot produce an accurate baud rate at 115.2K baud and above. The error at 115.2K baud is 2.1%, at 230.4K baud it is 3.5%, and at 460.8K baud it is 8.5%. It should work at 76.8K baud where the error is only 0.2%.
|kurakaira wrote: |
|Generic targets work great ,,, as long as You keep below ConsoleSpeed of 57600 ... 115200 does not work for my boards , is it a generic target issue or something i have overlooked ? |
You can see the list of baud rates and error values by using the Target Options dialog, setting the processor frequency, and clicking the Apply button.