serial settings, UART...

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello,
i have a problem setting my serial port to work under win2k, when i connect my avrboard to it nothing happens (avr was loaded with uart test code, both from my board manufacturer and peter fleury's uart lib and test-uart program, so at least one of them should work)
i'm using br@y++ terminal program for communication with the serial port.
i had similar problem on my other pc previously, and i dont know what am i doing wrong?
is it something with bios or...???
thanx!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need to first make sure your PC's serial port is working.

JChristoff
Illinois

Last Edited: Fri. Jan 7, 2011 - 03:19 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try to find ALLOWIO or similar prg to allow certain programs to use certain ports etc.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i tried connecting pins 2 and 3 and i get echo
(i downloaded allowio, but i believe terminal also has its driver, since i used it to check wether port will echo back....)
so i still dont know where do i make mistake.
this is all done on atmega8515 with 8MHz external clock and i attached the test code which i received with my devboard that i used (i used fleury's code also, but all i did there was change the uC type and clock value, still didnt work)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Default fuse setting is for use of 1MHz internal RC oscillator...have you changed the fuse settings to reflect your external 8MHz clock?

Regards,
Steve

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also, did you make sure that Br@ys settings matched that of your software, BAUD rate, number of data and stop bits, parity on/off, etc.?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes, the settins are the same (9600bps, 8 data, everything else is off)
eh, ill look at them fuses...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uhhhh....stupid question, where do i set the fuse bits? dont see any lines that are about that??? thnx

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

What programming hardware/software are you using (STK500 or ATAVRISP w/ AVR Studio, PonyProg with parallel port cable, etc.)?

Be careful if/when you figure out how to change the fuses. Make sure you select "External crystal/resonator" instead of "External oscillator". Those terms are based on the usage of AVR Studio, I am not sure how PonyProg calls it out.

Regards,
Steve

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i use easyAVR usb prog, with its own software, it has its own prog called ATFlash, now i am offered several choices for crystal:
external clock
internal RC osc. (choices for different speeds
external RC osc. (same as above)
external XTAL (as bove, but i can also choose between slow and fast startup (?))

i chose ext XTAL 3-8MHz fast startup, nothing still....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
with my devboard that i used

What model number and who is the manufacturer of the devboard you mention? Are there any schematics? Does the devboard contain a MAX232 (or whatever flavor) type of RS232 level translation chip?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have a scope? Turn on the CLKOPT fuse if 8 mhz or above. This makes the xtal pins output a 5V sine wave from the xtal. You can see if its oscillating no prob.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

my devboard is made locally here in serbia, company name is mikroElektronika (here is a link to the devboard i use http://www.mikroelektronika.co.y... ), there are schematics in print, but from what i see to it, MAX232 part of the board is the same as in most schematics i've seen on the net (with 4X1uF capacitors), so that shouldn't be a problem, i've compiled several other sources for uart (polled and interrupt driven), but still nothing

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Send UUUUUU at 9600 baud..... should see square wave 104usec on, 104 usec off

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ehhhh, no scope, too big for my current budget :) still heavy rookie for that kind of equipment...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

guys i tried using an example from the book "embedded Cprogramming and atmel AVR" on UART, this is code, i just ported it to avr-gcc instead of cvavr
it still does nothing....

#include
#include

void main(void)
{
UCSRC=0x18;
UBRRH=0x33;
UBRRL=0x00;

while(1)
{
printf("Yabba Dabba Doo!!!!");
}
}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well you have to tell printf where to output to for starters. IIRC CV has a default to the UART, while GCC has no such default, you must define it.

Also I suspect that should be UCSRB not UCSRC. You didn't mention what AVR, but the couple of datasheets I checked, RXEN and TXEN are in UCSRB, and they would equate to 0x18 if set to 1.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it is mega8515,
could anyone post me most basic and stupidest program which will send only few strings back and forth from this uC over UART, so i can check it is still alive
i use 8MHz clock
thanx!