EmbDev.net

Forum: µC & Digital Electronics How to read ATmega128RFA1 via UART-USB connected to the PC using HTerm?


von ektor (Guest)


Attached files:

Rate this post
useful
not useful
HELP!!

I have a ATmega128RFA1 via UART-USB connected to the PC and just want to 
check the correct transmission of data via the UART. I try to read the 
microcontroller with Terminal-Program HTerm on my PC configured this 
way: Baud:9600, data:8, stop:1, Parity:None, after try all I can not.
I have the ATmega128RFA1 microcontroller programmed with code enclosed.

Does someone could help me, please?, I don´t know what I'm doing wrong.

Thanks in advanced.

von anyone (Guest)


Rate this post
useful
not useful
I'm not profitient in c. But at least You should try

char str[]= "Hello world\0";

HTH

von Timmo H. (masterfx)


Rate this post
useful
not useful
You should set the UBRR0 Register BEFORE you Enable RX and TX.

anyone wrote:
> I'm not profitient in c. But at least You should try
>
> char str[]= "Hello world\0";
This is not necessary because the quotation marks already define a 
0-Termitated string in C. The \0 is appended automatically. So
char str[] = "1234" is 5 bytes long 0x31,0x32,0x33,0x34,0x00.

: Edited by User
von ektor (Guest)


Attached files:

Rate this post
useful
not useful
I have already try what you say but i can´t.
How should I configure Hterm terminal program?I enclose the screen of my 
Hterm.
I think now the code is correct, or should I add any printf?

Thanks.

von Timmo H. (masterfx)


Rate this post
useful
not useful
ektor wrote:
> I have a ATmega128RFA1 via UART-USB connected to the PC
Do you have a USB=> RS232 (with RS232 voltage levels) or a USB => UART 
(TTL) converter. You can't connect the Atmega UART to the RS232 directly 
since it has different voltage levels. Then you need a Level Converter 
IC like MAX232 or Max3232. And of cause you should check the right 
connection of Tx(AVR)=>Rx(PC) and vice versa

: Edited by User
von A. W. (uracolix)


Rate this post
useful
not useful
Beside wiring issues, a common point for UART failures are fuse -, 
clock settings and the choice of F_CPU.

Also check if hardware flow control is disabled in the terminal program.

Debug Hint: Write a endless loop in a test programm that transmits 
permanent, e.g. letter "A" and then configure the terminal until you see 
the "A".

: Edited by User
von ektor (Guest)


Attached files:

Rate this post
useful
not useful
Timmo H. wrote:
> Do you have a USB=> RS232 (with RS232 voltage levels) or a USB => UART
> (TTL) converter.

I am using USB-UART TTL converter.
This one:
(https://shop.dresden-elektronik.de/accessories-1/levelshifter/usb-pegelwandler-stick-low-power.html).

A. W. wrote:
> Beside wiring issues, a common point for UART failures are fuse -,
> clock settings and the choice of F_CPU.

I think all the fuses are correctly.(see screen enclosed).

> Also check if hardware flow control is disabled in the terminal program.

The flow control is disabled.
>
> Debug Hint: Write a endless loop in a test programm that transmits
> permanent, e.g. letter "A" and then configure the terminal until you see
> the "A".

Would be correct an example like the c example that I enclose?

von Timmo H. (masterfx)


Rate this post
useful
not useful
And you're sure that you connected Pin1 of the Converter to Pin 47 and 
Pin4 of the Converter to Pin 46 of the Atmega? And of cause the ground 
(Pin6) to your target board GND?

von A. W. (uracolix)


Rate this post
useful
not useful
The link to the USB converter is broken.
What hardware do you use at all (e.g. which RFA1 PCB, a comercial one or 
a home-brew)?

: Edited by User
von Timmo H. (masterfx)


Rate this post
useful
not useful
I don't have the RFA1. But as USB => UART TTL Converter this one works 
great: http://www.ebay.de/itm/400414654693

von ektor (Guest)


Attached files:

Rate this post
useful
not useful
Hello!

I have the ATmega128RFA1 coneccted to the PC with the USB-UART TTL 
converter like I 
said(https://shop.dresden-elektronik.de/accessories-1/levelshifter/usb-pegelwandler-stick-low-power.html)
 and it should work correctly because all pins and conecction are 
correctly connected because I am using a board(I enclose a picture), but 
I am sure that I am doing something bad in the programation or the Hterm 
configuration.


In the Hterm CW-Keyer that I enclose we can read that I need to install
Prerequisites

Before inserting the CWKeyer the first time in your PC must be installed 
the appropriate drivers (if you have not done so as well). The chip used 
is a by FTDI FT232. There are drivers for Windows, Linux and Mac here: 
http:\\\/\\\/www. ftdichip. com\\\/Drivers\\\/VCP. htm after 
installation the manipulator can be inserted. Now this must login as 
"eHaJo CWKeyer".

Should I do?

How can I get read the ATmega128RFA1 with Hterm?:C Help¡¡

Thanks in advance.

von Timmo H. (masterfx)


Rate this post
useful
not useful
If your USB TTL converter is based on a FTDI Chip, of cause you have to 
install the drivers first (from here 
http://www.dresden-elektronik.de/funktechnik/service/downloads/software/?L=0 
or http://www.ftdichip.com/Drivers/VCP.htm )
After you did that you plug in your USB UART Converter and a virtual 
COM-Port should appear in the device manager like here: 
http://www.ladyada.net/images/arduino/devicemanager.jpg
Behind the name you see the assigned COM-Port number (e.g. COM12).
In hterm you connect to this COM-Port with the baudrate and 
configuration you also set in your atmega such as 9600 8N1.
Thats it.

von ektor (Guest)


Attached files:

Rate this post
useful
not useful
Thank you very much, I did it time ago because of that i answer about 
CWkeyer.
My code and my configuration is like i showed but it is  impossible to 
read by Hterm.

The C code that I enclose is correct?
Whith this code should I read anithing on HTerm or shud I modify 
anything?

How have I to configure the HTerm?
I just configure Baud:9600, data:8, stop:1, Parity:None

von Timmo H. (masterfx)


Rate this post
useful
not useful
Until now you didn't answered my question
Timmo H. wrote:
> And you're sure that you connected Pin1 of the Converter to Pin 47 and
> Pin4 of the Converter to Pin 46 of the Atmega? And of cause the ground
> (Pin6) to your target board GND?
Are you sure you checked the right connection?!

ektor wrote:
> The C code that I enclose is correct?
Now your code has changed since you last post. To use "printf" you have 
to do a little bit more:
http://www.mikrocontroller.net/articles/AVR-GCC-Tutorial#Die_Nutzung_von_sprintf_und_printf

But you can use your sendestring function which seems to be correct.
And you really should set the UBRR0 BEFORE you enable the tx and rx as I 
said before.

: Edited by User
von ektor k. (Company: Technische Universität München) (ektor)


Attached files:

Rate this post
useful
not useful
Hello¡¡

Timmo H. wrote:
> Until now you didn't answered my question

Sorry, I thought that with the picture was ok, I think all is correctly 
connected because it already design by deRFbreakout Board for pluggable 
radio 
modules(http://www.dresden-elektronik.de/funktechnik/products/boards-and-kits/development-boards/derfbreakout-board/description/?L=1).
In this case Pin1 of the Converter to Pin 28 and
Pin4 of the Converter to Pin 26 of the deRFbreakout Board.GND is aswell 
good coneccted.
I enclose a picture of the conections and the deRFbreakout Board 
Datasheet. I have checked all and I think is ok. My conponents are 
conected like i show you in the picture 222.


> But you can use your sendestring function which seems to be correct.

So If have the deRFmega128 programmed whit the first C code with the 
sendestring what should I do for get read anything in Hterm? Should I 
write anything for get data, or just should I be able to read without 
write?
I have tried all.:C

Thank you!!

von ektor k. (Company: Technische Universität München) (ektor)


Attached files:

Rate this post
useful
not useful
Thank you for help but unfortunately I can not read data from 
ATmega128RFA1.
Whith the code that now I enclose, should I able to see a Hello World 
just connecting with Hterm?

Help¡¡

von A. W. (uracolix)


Rate this post
useful
not useful
If you remove the while(1) endless loop, the string will be displayed 
again and again.

If you are the originator of this thread 
Beitrag "Verknüpfung der Sensordatenabfrage(LTC2498) mit der Funkverbindung(ATmega128RFA1)", please avoid double 
postings, lets stay at one thread and solve the issues step by step.

von ektor k. (Company: Technische Universität München) (ektor)


Rate this post
useful
not useful
Hello,

I am sorry!!
Now I can read the messege on my Hterm¡¡
Thank you very much!!

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.