Newbie UART question. Thanks

May 13, 2006 6 Replies

I would like to connect two AVR 8535 uC with UART serial link by TxD and RxD. I am using BASCOM-AVR.



I can use "print" command to show the desired value on terminal emulator (default rs232 port to pc). However, I can not receive this value when I transmit it by TxD (Port group D, pin1) and connected with a wire to other uC RxD (Port group D, pin0). I've try to use command such as "input', "waitkey", "inkey", "inputbin" to input, but still can't receive the value from master uC.



I set bith crystal at 8MHz and Baud at 9600.



Could you guy please let me know What I did wrong.


sommes scrobe on the papyrus:

Two things you did wrong. Firstly you used an 8MHz crystal. With a

7.3728MHz crystal you can achieve 115200Baud with no errors. Secondly you used BASCOM-AVR, but maybe you don't have a choice. >-:}
John B

You might also try asking this over on alt.microcontrollers.8bit and comp.arch.embedded.

I work with the AVR chips and their UARTs quite frequently but use asm or C to write my own ISRs; afraid I don't have a clue about the particular quirks of BASCOM.

Rich Webb Norfolk, VA

Maybe it gets between you and the hardware. Compilers sometimes do such things, and especially Basic compilers. But I've not used this particular one. Serial reception is one of those things that's tied up with OS-like issues. Often it has to be interrupt-driven to be practical in all but the most mindless of applications. So you end up with buffers and read pointers and write pointers and that sort of stuff.

Best regards, Spehro Pefhany

"it\'s the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

sommes scrobe on the papyrus:

There is no standard for BASIC compilers. If you choose a C compiler you will have an ANSI reference standard to work to and all compliant compilers should compile the same source code. Although the resultant machine code may be different the action should be the same.

Alternatively work in assembler and then you know what is happening.

John B

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required