HI
Have a problem with the RS232 Component
If I compie to HEX using RS232 Component with Target set at Mega32 all is okay
However if i do same again but with Mega 162 selected I get multiple compiilation errors ie the UART functions UBRRH etc etc are not defined
Note Mega162 has 2 UARTS so its registers have different names ie UBRR0H & UBRR1H
It would appear that flow code is not recognising this requirement ie it should be defining UBRR0H not UBRRH
Any comments
RS232 ISSUING WHEN USING MEGA162
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 ISSUING WHEN USING MEGA162
Hello
We will look into this problem for you.
However a simple temporary fix would be to go into the Edit - Supplementary code window and enter the following line of code into the top window.
Repeat this for all of the registers that are flagged as not defined.
We will look into this problem for you.
However a simple temporary fix would be to go into the Edit - Supplementary code window and enter the following line of code into the top window.
Code: Select all
#define UBRRH UBRR0H
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: RS232 ISSUING WHEN USING MEGA162
Thanks for prompt reply
I had already tried this before I sent the querry and it worked however it would be time consuming for all the other registers
I was wondering why Flowcode was not picking it up automatically
I had already tried this before I sent the querry and it worked however it would be time consuming for all the other registers
I was wondering why Flowcode was not picking it up automatically
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 ISSUING WHEN USING MEGA162
Hello
The problem is due to a small bug in the component code file. Once this has been updated the program should compile correctly again without having to redefine registers. You may wish to update this RS232.C file by hand or search/replace techniques to use the correct register names. However this will mean that your component code file will then not work for other devices. We will post the updated component file onto the forums as soon as we get chance to dig in and fix this.
The problem is due to a small bug in the component code file. Once this has been updated the program should compile correctly again without having to redefine registers. You may wish to update this RS232.C file by hand or search/replace techniques to use the correct register names. However this will mean that your component code file will then not work for other devices. We will post the updated component file onto the forums as soon as we get chance to dig in and fix this.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: RS232 ISSUING WHEN USING MEGA162
The problem was caused by two missing definitions in the ATMEGA162.fcd file. I have attached a corrected version of this file.
Copy the file to the FCD folder of the Flowcode for AVR installation, replacing the original copy.
Compilation generates two warnings regarding redefinition of UMSEL0 and UMSEL1. These can be ignored.
Copy the file to the FCD folder of the Flowcode for AVR installation, replacing the original copy.
Compilation generates two warnings regarding redefinition of UMSEL0 and UMSEL1. These can be ignored.