Arduino Serial Communication 16Mhz to 8Mhz

Hi guys, so i'm trying to establish communication between an arduino Uno running at 5V and 16Mhz which is my Tx and a pro mini being the Rx running at 3.3V and i assume 8Mhz, i'm using a voltage divider on the Rx pin to drop down the voltage to 3.3V, I have also programmed the the pro mini at 5V-16Mhz since i don't have a 3.3v programmer( not sure if this would make any difference)
ok so the problem is that my data doesn't make it to the other side. i've used a scope to monitor the serial line and i can see the signal arriving on the other side, but i get no response. i have tested my Rx code on the uno using the serial monitor to send the packets and it works fine, so i'm thinking there might be a problem with the baud rates or something i'm out of ideas.. i've tried 9600, 57600,115200,200000 with no luck.. any help would be appreciated!

Post the code.

Mark

code is extremely long to post.. i found a solution tho, doubling the baud rate at the 8Mhz end fixes it..

motion86:
doubling the baud rate at the 8Mhz end fixes it..

That suggests that your boards settings are wrong (wrong clock speed selected). Perhaps you selected the wrong board type, or that board type is not defined correctly. Don't be surprised if millis() and micros() give the wrong answer too. It would be better to correct the problem rather than work around it.

PeterH is correct. You may find this thread informative:

http://forum.arduino.cc/index.php?topic=124879.0

Also, this page shows why you want to use something like 38400 and not anything faster:

http://www.wormfood.net/avrbaudcalc.php

yeah i'm thinking the problem comes from the fact that i'm programming the chip with a 5V serial to usb cable, which makes the chip run at 16Mhz at the time the programming occurs which prevents me from selecting the 8Mhz board from the IDE i'm forced to use the 16Mhz selection otherwise i get sync errors and the sketch doesn't upload

How does the USB cable make the chip run at 16MHz? I haven't heard of that before.

It is perfectly permissible to run the Atmega at 8MHz on 5V. I do it all the time.

The voltage will not affect the clock speed -- only the 'fuse' setting (boards.txt) does that. To change the 'fuse' settings, you'll need to use an ISP programmer. I use another Arduino as my ISP programmer -- see

so why does the baud rate get affected when i program it as a 16Mhz device, and why can't i program it as 8Mhz?

You say "I have also programmed the the pro mini at 5V-16Mhz" but you haven't. It's still 8MHz. When you select a 16MHz 'Board', you're telling the Arduino IDE it's running at 16MHz but this does NOT actually change the speed to 16MHz -- that stays at 8MHz until you use an Arduino as ISP to perform a 'Burn bootloader'.

WARNING: Do NOT use the Arduino as ISP to burn a 16MHz bootloader onto your Mini unless you have desoldered the 8MHz crystal and replaced it with a 16MHz part!

What you probably want to do is select the 8MHz Board and upload your sketch to the Mini again. If you're having trouble uploading a sketch with the 8MHz board selected, check to make sure you are selecting the correct Mini chip, either 328 or 168 (may need a magnifying glass to determine what chip you have). Trying to program a 168 as a 328 or vice versa will not work.

the chip is 328P, and it programs when i select the 5v board, but not the 3v... if the chip runs at 8Mhz then why is the serial running at half the speed?

motion86:
the chip is 328P, and it programs when i select the 5v board, but not the 3v... if the chip runs at 8Mhz then why is the serial running at half the speed?

When you select the 5v board, the Arduino core thinks you're running at 16MHz. You're really running at half that speed, so the serial baud rates have to be set double what they should be.

Where did you get your Pro Mini? Is is an official Arduino board or a clone?

If it's really an 3.3V 8MHz Pro Mini that only can only upload when the 5V/16MHz option is selected, then I suspect you have an unofficial clone board with the wrong bootloader burned on to it.

it is a clone, but if the bootloader si the one for the 16Mhz version.. the everything should be fine right and i would experience no problems, or am i wrong?

motion86:
it is a clone,

Typical. I got some cheap Nano clones that had no bootloader at all. Sigh.

but if the bootloader si the one for the 16Mhz version.. the everything should be fine right and i would experience no problems, or am i wrong?

The problems you would experience with the wrong bootloader are: serial, I2C, SPI, millis(), delay(), delayMicroseconds, and micros() all run at half speed. Also, PWM frequencies will probably be halved.

Personally, I would use my Uno as ISP to Burn the correct 8MHz Bootloader onto the Mini. And then contact the folks that sold the board and advise them they they're shipping a faulty product.

oh i get it so they have a 16Mhz bootloader, but the crystal is 8Mhz so the chip can not run any faster then 8 but is thinking it goes 16..

Optiboot has a board for a 386 running at 8MHz - Google Code Archive - Long-term storage for Google Code Project Hosting. - just follow the instructions