Hello,
I tried to set the serial speed to 115200 baud, but I got lots of nonsense over my serial line. Is it possible to set the speed to 115200 baud witout adding an external crystal oscillator? I'm pretty new to the topic of avr-programming and I want to hook up my geiger counter direclty to a seagate dockstar, which only communicates at 115200 baud...
115200 baud possible?
Re: 115200 baud possible?
Hello flop,
How did you change the baud rate to 115200?
How did you change the baud rate to 115200?
Jeff Keyzer
http://mightyohm.com
http://mightyohm.com
Re: 115200 baud possible?
Hi Jeff,
I just changed the define-value in your geiger.c
I just changed the define-value in your geiger.c
Code: Select all
[...]
// Defines
#define VERSION "1.00"
#define URL "http://mightyohm.com/geiger"
#define F_CPU 8000000 // AVR clock speed in Hz
#define BAUD 115200 // Serial BAUD rate
#define SER_BUFF_LEN 11 // Serial buffer length
#define THRESHOLD 1000 // CPM threshold for fast avg mode
#define LONG_PERIOD 60 // # of samples to keep in memory in slow avg mode
#define SHORT_PERIOD 5 // # or samples for fast avg mode
#define SCALE_FACTOR 57 // CPM to uSv/hr conversion factor (x10,000 to avoid float)
#define PULSEWIDTH 100 // width of the PULSE output (in microseconds)
[...]
Re: 115200 baud possible?
Ok, while in theory that change should do it, according to this calculator, 115200 baud won't work with an 8MHz clock (resonator or crystal):
http://www.wormfood.net/avrbaudcalc.php
You'll need to change the external resonator to 9.216MHz or one of the other frequencies shown that lists 115200 in green. A crystal might be required if the resonator isn't accurate enough. Since crystals require shunt capacitors, you would need to solder those to the back of the board (usually around 20pF per leg).
Changing the clock frequency of the AVR has other implications, too - the settings for the timers will need to be adjusted and there is a maximum clock frequency rating that depends on battery voltage. I think 12MHz is the max at 3V.
http://www.wormfood.net/avrbaudcalc.php
You'll need to change the external resonator to 9.216MHz or one of the other frequencies shown that lists 115200 in green. A crystal might be required if the resonator isn't accurate enough. Since crystals require shunt capacitors, you would need to solder those to the back of the board (usually around 20pF per leg).
Changing the clock frequency of the AVR has other implications, too - the settings for the timers will need to be adjusted and there is a maximum clock frequency rating that depends on battery voltage. I think 12MHz is the max at 3V.
Jeff Keyzer
http://mightyohm.com
http://mightyohm.com
Re: 115200 baud possible?
Hi Jeff,
So something like this should do the job?
(You see, I'm a real newbie to this topic)
So something like this should do the job?
(You see, I'm a real newbie to this topic)
Re: 115200 baud possible?
The capacitors should go from either side of the crystal to ground.
Out of curiosity, why do you need the geiger counter to operate at 115200 baud? It might be easier to change the other end of the link to 9600...
Out of curiosity, why do you need the geiger counter to operate at 115200 baud? It might be easier to change the other end of the link to 9600...
Jeff Keyzer
http://mightyohm.com
http://mightyohm.com
Re: 115200 baud possible?
The Seagate Dockstar has serial pins on the board, but only communicates at 115200 baud. Although I can see two serial devices (/dev/ttyu0 and /dev/ttyu1) I can only see one TX and one RX pin. Unfortunately this devices are pretty undocumented and /dev/ttyu0 is mostly used as remote serial console for the Dockstar itself. I think I just have to get another ca-42-cable for usb-to-serial-communication and forget about using the on-board port...
Re: 115200 baud possible?
I think a usb-serial adapter is the way to go, otherwise you might have problems with console messages interfering with your serial comms.. I ran into this when I was hacking the WL-520gU router for my wifi radio project.
Jeff Keyzer
http://mightyohm.com
http://mightyohm.com