#1 2015-10-09 05:55:40

Henry
Member
Registered: 2015-07-22
Posts: 6

9600 to 4800

I thought that changing in the device.h file baud rate from 9600 to 4800 would do the trick. But the modem stays at 9600!?  There must be or other parameters the this newbie is not seeing. Can someone help?

Henry

Offline

#2 2015-10-09 06:26:21

DB1NTO
Member
Registered: 2014-12-01
Posts: 52

Re: 9600 to 4800

Hi Henry, just:

Serial.begin(4800);

If it's not working, you selected maybe wrong MHz somewhere (Arduino IDE)

Taner

Offline

#3 2015-10-11 20:09:18

Henry
Member
Registered: 2015-07-22
Posts: 6

Re: 9600 to 4800

Taner:

I'm working with the MicroModemGP code.

There is only one line I see in device.h that refers to baud rate

// Serial settings
#define BAUD 9600


I changed this , simply, to

// Serial settings
#define BAUD 4800

But the modem data was srambled when I tried to transmit on 4800 baud. It wasn't right until  I transmitted on 9600. So it wasn't changed?

Any ideas?

Henry

Offline

#4 2015-10-12 21:02:25

markqvist
Administrator
Registered: 2014-12-01
Posts: 112

Re: 9600 to 4800

Hi Henry!
That's strange, that should really be all there is to it. Just tried successfully with 4800, 9600, 19200 ad 115200 baud. But I'm using the plain MicroModemGP repository, you're using your own modified version, right?

But how is the baud rate actually set? I can see why this is a little confusing... We just set a define, and it magically happens ;P But in "Serial.c" you will find this line:

#include <util/setbaud.h>

In this file, the actual setting of timing registers and such happens, and to do this, it reads two defines: F_CPU and BAUD. The file is part of avr-libc. Are you compiling against standard avr-libc? Maybe check your own version of setbaud.h to see if it expects other define names?

Offline

Board footer

Powered by FluxBB