Is there a way to set the IDE to use a non-0standard baud rate for the serial port?
I am using the ZBaasic IDE and ZBoot bootloader on an ATMega328P which has a 16MHz crystal. Additionally it has a USB interface using a FT232R USB-Serial converter.
Needless to say, the 16MHz clock on the AVR renders it unable to create all the Standard baud rates, and only the slower rates are able to come close enough to synch properly.
I'd love to be able to get faster baud rates without running risk of com errors with long transmissions.
The FT232R is able to accept non-standard baud rates. Essentially, it can achieve a perfect synch with the 16MHz AVR at any baud rate it is capable of producing. The FT232R uses a clock that can produce a baudrate of 24MHz divided by any integer with a maximum baud of 3M.
So, I can achieve just as good serial communication with the device using certain non-standard baud rates as one can with a 14.7MHz clock on the ZX devices with standard baud rates. I just need to get the IDE to offer some non-standard baud rates.
-Tony
Non standard baud rates in the IDE?
Re: Non standard baud rates in the IDE?
Although I haven't tried this, I suspect that you can accomplish this is by editing the User Properties file manually. Look for entries like those below and substitute your non-standard rates.spamiam wrote:Is there a way to set the IDE to use a non-standard baud rate for the serial port?
Code: Select all
debug.speed=19200
download.speed=57600
- Don Kinzer
I've added properties to specify the baud rates to display in the dropdown listboxes for the debug baud rate and download baud rate. The properties are debug.speed.list and download.speed.list and the value should be a comma-separated list of baud rates, e.g.spamiam wrote:I was hoping that maybe there would be a complete editable list somewhere that is used to populate those IDE choice boxes.
Code: Select all
download.speed.list=9600,10000,19200
You can try out this experimental version by downloading the .zip file at the link below and extracting the .exe file to the IDE subdirectory of the ZBasic installation directory. This version also fixes the Project|Open issue reported in another thread.
http://www.zbasic.netl/download/ZBasicI ... _1-6-8.zip
- Don Kinzer
Don,
Thanks for the changes! I had a little trouble with it, however.
I entered the changes in the file popped up by selecting the menu: Option->Open User Options File
I changed the line
to
When I reopened the IDE, it populated the list with all the items listed. But the list in User Options disappeared entirely after I selected one of the listed speed, and the text res replaced by the single speed selected, and the combobox then only got populated by the default speeds, no longer the customized list.
Maybe I put the list in the wrong file?
I can confirm that the technique of setting non-standard speeds works GREAT. I made the changes you suggested with the older IDE. I picked 125000 baud as one that will work with the USART on the ATMega328P when it is set on Single Speed. I created a customized bootloader very easily with your BAT file and H file. The IDE downloaded the program to the chip just fine at 125000 baud. It communicated to the Output Pane jsut fine too. BUT the new IDE does not seem to communicate properly with the user options set to download.speed=125000 and the debug speed set similarly. I can't tell what speed it is actually using, but it is not 125000.
-Tony
Thanks for the changes! I had a little trouble with it, however.
I entered the changes in the file popped up by selecting the menu: Option->Open User Options File
I changed the line
Code: Select all
download.speed=115200
Code: Select all
download.speed.list=300,600,1200,2400,4800,9600,14400,19200,28800,38400,50000,57600,76923,100000,115200,125000,230400,250000,460800,500000
Maybe I put the list in the wrong file?
I can confirm that the technique of setting non-standard speeds works GREAT. I made the changes you suggested with the older IDE. I picked 125000 baud as one that will work with the USART on the ATMega328P when it is set on Single Speed. I created a customized bootloader very easily with your BAT file and H file. The IDE downloaded the program to the chip just fine at 125000 baud. It communicated to the Output Pane jsut fine too. BUT the new IDE does not seem to communicate properly with the user options set to download.speed=125000 and the debug speed set similarly. I can't tell what speed it is actually using, but it is not 125000.
-Tony
I remember now that there has been a problem such as you describe when a property being updated is a prefix of another. I fixed that problem and it seems to update fine now leaving other properties untouched. I uploaded a new .zip file with the new build but the version number was left the same.spamiam wrote:But the list in User Options disappeared entirely after I selected one of the listed speed, and the text res replaced by the single speed selected [...].
I'm not clear on what does work and what does not work. Can you summarize, please?spamiam wrote:BUT the new IDE does not seem to communicate properly with the user options set to download.speed=125000 and the debug speed set similarly.
- Don Kinzer
Don,
It is perfect!
I am running ZBoot at 125K baud, single speed. It is able to upload programs and communicate to the Output pane at 125K as well.
The Zbasic system is now, as far as I can tell, 100% compatible with any arbitrary crystal frequency. At most, all one needs to do is adjust settings when compiling a new ZBoot file.
Thank you!
-Tony
It is perfect!
I am running ZBoot at 125K baud, single speed. It is able to upload programs and communicate to the Output pane at 125K as well.
The Zbasic system is now, as far as I can tell, 100% compatible with any arbitrary crystal frequency. At most, all one needs to do is adjust settings when compiling a new ZBoot file.
Thank you!
-Tony