Serial1 Arduino Mega su usb-rs232 adapter

Ciao

dovrei collegare la Serial1 di una Arduino Mega con il pc attraverso un adattatore USB-seriale.

Ho provato con PIN19 mega -> PIN3 porta seriale-usb
PIN18 mega -> PIN2 porta seriale-usb

poi

Serial1.begin(19200);
Serial1.println("xxxxx");

Ma sul terminale del pc (uso un mac con CoolTerm, settato a 19200) non leggo niente... sicuramente sbaglio qualcosa... ma cosa?? :sweat_smile:

grazieee

Datasheet dell'adattatore?

cmq TX con RX e RX con TX

e massa in comune :slight_smile:

Settando CTS e DTR sul progrmma ricevo qualcosa, ma se faccio println("test") ricevo: QStT..

... :frowning: qualche suggerimento ?

Collegando il 19 TX della Mega sul pin 1 (tx) di una board arduino senza ATMEGA a sua volta collegata con il pc via usb, riesco a leggere correttamente i dati... Mi piacerebbe però usare l'adattatore... :sweat_smile:

ypkdani:
Datasheet dell'adattatore?

lesto:

ypkdani:
Datasheet dell'adattatore?

E' un adattatore che usa un PL2303 della prolific... non so se esiste un datasheet.. :frowning:

Se non sbaglio è lo stesso integrato che sta nei cavi nokia ca-42

Questo:

non so voi ma ora il sito è leeentoo.

comuqnue, tanto per cominciare è un adattatore a 3.3V, per fortuna funziona lo stesso perchè l'1 logico di arduino è 3V se alimentato a 5V ( e arduino DEVI alimentarlo a 5v o varie impostazioni di fuse di incasinano).

altro particolare da: DIY USB to Serial Cable For $3! – uCHobby

Level Translation Note
You may have noticed that the cable’s output level isn’t 5V; it’s 3.3V. So how does it work when the ATmega expects 5V? Well if you’ll look at the ATmega datasheet you’ll see that the minimum input high VIH is 0.6VCC, which is 3V when VCC is 5V. So even though the cable puts out only 3.3V the ATmega still recognizes it as a high. Going the other way, the ATmega TxD pin puts out 5V which is possibly too high for the PL-2303 chip to receive without being damaged. This is why a voltage divider was put on the cables RxD line; 5V(15/(10+15)) = 3V. For the PL-2303HX rev. A the voltage divider is not necessary because it’s RxD pin is 5V tolerant. Other chip versions may not be; Check their datasheets.