Page 1 of 1

convert rs232 demo to avr

Posted: Mon Sep 09, 2013 11:08 pm
by JoeT
I am trying to convert the "rs232 simple echo" demo to a AVR Atmega128.
It will compile ok but if I try to create a HEX file it gives the error:
C:\Program Files (x86)\Flowcode 6\CAL\/AVR\AVR_CAL_UART.c:600:8: error: #error "UART channel 1 not available on this device"
This chip has two channels.
I went to "project options" change to atmega128 and the clock speed to 16mhz. Saved it and complied to "C". I went to the component dialog and when I select channel 1 the port pins change to the correct pins (E.0,E.1). It shows: Software; Channel1; Channel2; as selections.

What have I missed?
JoeT

Re: convert rs232 demo to avr

Posted: Tue Sep 10, 2013 10:26 am
by Benj
Hi Joe,

Nothing you have missed just a minor bug, this is something that will be completely fixed in the next patch release.

For now you should be able to fix the issue by copying the file below into your Flowcode/CAL/AVR folder.
AVR_CAL_UART.c
(57.91 KiB) Downloaded 576 times
Then place the updated FCD into the FCD/AVR folder.
ATMEGA128.fcdx
(25.67 KiB) Downloaded 537 times
Let me know how you get on.

Re: convert rs232 demo to avr

Posted: Tue Sep 10, 2013 4:56 pm
by JoeT
I downloaded the files and replace the old files with these.
Shut down flowcode and restarted.
No difference.
I tried software uart and it seems to work. At least compile to hex without errors.
But after I downloaded to the avr, I would get data but it was trash.
I tried different baud rates on the terminal program but no help.

When in project options can I change the crystal freq to a number like 14745600 hz?
Are only the selections in the drop down allowed?
I was wondering if this was the problem with the software uart.

JoeT

Re: convert rs232 demo to avr

Posted: Wed Sep 11, 2013 2:24 am
by JoeT
I am able to write to a 16x2 LCD from the program. With the clock (avr) freq of 14745600hz.
So the freq select seems to work with a inserted value.
If I type to the LCD via rs232 I get trash.

JoeT

Re: convert rs232 demo to avr

Posted: Thu Sep 19, 2013 7:32 pm
by Benj
Hi Joe,

Sorry for the delay.
When in project options can I change the crystal freq to a number like 14745600 hz?
The drop down selection in the project options also allows for direct number entry so you can put in custom values like this. If this setting is wrong then it explains why your data is not working as the baud will be being calculated incorrectly for your hardware.