Pages: [1]   Go Down
Author Topic: Problem with Serial port communication on Arduino UNO  (Read 1824 times)
0 Members and 1 Guest are viewing this topic.
Salt Lake City
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Everyone,

I am trying to do serial port communication with a PC using Arduino UNO.
I opened the serial port at 115200 baud rate.
I am able to send the data to the computer at that rate.
But, the data is coming to the Arduino at 9600 baud rate only. Even if I change the baud rate at which I am opening the serial port, it remains the same.
So, the data received by the Arduino is fixed at 9600 baud rate and is not getting changed.
Please help me out on how to increase the receiving data rate.

Regards,
Anil Palaparthi.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But, the data is coming to the Arduino at 9600 baud rate only.
Coming from where? That is where you need to tell "it" (whatever it is) to send the data faster.
Logged

Salt Lake City
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply.
The data is coming from the computer.
I specified the baud rate in the computer and also in the arduino to be 115200.
But, the data coming from the computer is only 9600 baud.
That is what I am not able to figure out.

Regards,
Anil Palaparthi.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply.
The data is coming from the computer.
I specified the baud rate in the computer and also in the arduino to be 115200.
But, the data coming from the computer is only 9600 baud.
That is what I am not able to figure out.

Regards,
Anil Palaparthi.

Well then it's not an Arduino caused problem. How are you actually setting the PC baudrate? It's still not clear what PC software or commands you are using for communications setup? Help us help you.

Lefty

Logged

Salt Lake City
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I am using visual c++ 9 to talk to the serial port on the computer.
I am using serial library.
I tested my program on other computer. Now the data transmission is taking place at 38400 baud rate.
So, what I figured out is that my computer is not allowing me to transfer the data at higher rate than a particular baud rate.
Is there anyway that I can fix that.
I am using windows 7 and 64 bit machine.

Regards,
Anil Palaparthi.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But, the data coming from the computer is only 9600 baud.
How do you know this? Do you mean that you can only read the data when the Arduino baud rate is set to 9600?

Quote
Is there anyway that I can fix that.
Show us your code.
Logged

Salt Lake City
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Everyone,

Sorry for responding so late.
I don't think I can share my code yet due to some licensing issues.
But, I have a quick question.
what is the default baud rate that the bootloader in the ATMega8U2 or ATMega328 have?

Regards,
Anil Palaparthi.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Everyone,

Sorry for responding so late.
I don't think I can share my code yet due to some licensing issues.
But, I have a quick question.
what is the default baud rate that the bootloader in the ATMega8U2 or ATMega328 have?

Regards,
Anil Palaparthi.

There is a file in the Arduino 'core' named boards.txt that defines the bootloader baudrate for all the supported board types that work with the standard arduino IDE distrubution. Locate your specific board from the text and see the "upload.speed=xxxxx" statement to see what baudrate it's bootloader is using:

For current IDE version .22: Note: partial list as file is to large to post in total
Quote
##############################################################

uno.name=Arduino Uno
uno.upload.protocol=stk500
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino

##############################################################

atmega328.name=Arduino Duemilanove or Nano w/ ATmega328

atmega328.upload.protocol=stk500
atmega328.upload.maximum_size=30720
atmega328.upload.speed=57600

atmega328.bootloader.low_fuses=0xFF
atmega328.bootloader.high_fuses=0xDA
atmega328.bootloader.extended_fuses=0x05
atmega328.bootloader.path=atmega
atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
atmega328.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F

atmega328.build.mcu=atmega328p
atmega328.build.f_cpu=16000000L
atmega328.build.core=arduino

##############################################################

diecimila.name=Arduino Diecimila, Duemilanove, or Nano w/ ATmega168

diecimila.upload.protocol=stk500
diecimila.upload.maximum_size=14336
diecimila.upload.speed=19200

diecimila.bootloader.low_fuses=0xff
diecimila.bootloader.high_fuses=0xdd
diecimila.bootloader.extended_fuses=0x00
diecimila.bootloader.path=atmega
diecimila.bootloader.file=ATmegaBOOT_168_diecimila.hex
diecimila.bootloader.unlock_bits=0x3F
diecimila.bootloader.lock_bits=0x0F

diecimila.build.mcu=atmega168
diecimila.build.f_cpu=16000000L
diecimila.build.core=arduino

##############################################################

mega2560.name=Arduino Mega 2560

mega2560.upload.protocol=stk500v2
mega2560.upload.maximum_size=258048
mega2560.upload.speed=115200

mega2560.bootloader.low_fuses=0xFF
mega2560.bootloader.high_fuses=0xD8
mega2560.bootloader.extended_fuses=0xFD
mega2560.bootloader.path=stk500v2
mega2560.bootloader.file=stk500boot_v2_mega2560.hex
mega2560.bootloader.unlock_bits=0x3F
mega2560.bootloader.lock_bits=0x0F

mega2560.build.mcu=atmega2560
mega2560.build.f_cpu=16000000L
mega2560.build.core=arduino

##############################################################

mega.name=Arduino Mega (ATmega1280)

mega.upload.protocol=stk500
mega.upload.maximum_size=126976
mega.upload.speed=57600

mega.bootloader.low_fuses=0xFF
mega.bootloader.high_fuses=0xDA
mega.bootloader.extended_fuses=0xF5
mega.bootloader.path=atmega
mega.bootloader.file=ATmegaBOOT_168_atmega1280.hex
mega.bootloader.unlock_bits=0x3F
mega.bootloader.lock_bits=0x0F

mega.build.mcu=atmega1280
mega.build.f_cpu=16000000L
mega.build.core=arduino

##############################################################




Lefty
Logged

Salt Lake City
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Everyone,

I still couldn't solve this issue.
I am attaching my code here.
serial folder has the program written in the microsoft visual studio 2008 to communicate with the arduino UNO board.
Helloworld.cpp is the main program.
change the serial port number in the Helloworld.cpp file and you can see the output written to file.txt file.

AnalogInOutSerial2 is the arduino UNO program.
The transmission rate is very slow at the moment even though I am transmitting at 115200 baud.
please feel free to run the programs on your machine and help me find the issue.

Regards,
Anil Palaparthi.

* programs for forum.zip (403.36 KB - downloaded 22 times.)
Logged

Salt Lake City
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I had removed the .ncb file from serial folder because of space constraints.
If you can't run the .sln file, create a new win32 console application project and copy the two .cpp files and one .h file in the serial folder into the new project and run it.

Regards,
Anil palaparthi.
Logged

Pages: [1]   Go Up
Jump to: