I am using stk6oo with atmega2560( using usart0) to communicate with my PC.I use AVR studio 17 for coding and burning the code.I too do not see anything on my Bray's Terminal.
At pin PE1 which is the TXD as per the datasheet I see 5.1 V. I connect the RS232 spare header and Pins PE0 an PE1 as
follows:
Pin PE0 of usart0 to RXD of RS232 spare header and
Pin PE1 of usart0 to TXD of RS232 spare header
Is this connection correct and sufficient or is there anything else to be done other that the above connections and of course the power connection through USB and RS232 male connecter to the RS232 D sub(female coupler) of the stk600 board?
Could anyone please clarify what external connections are to be used?
Please excuse me for the length of my message. I thought I better be clear .
I have always used the traditional way of using 8 bits, 1 stop bit, no parity bits.
Also I have attached my 'fuses' tab screen shot along with .
Also is there any way to check what the actual frequency on board stk00 is?
Controller signature is consistent.
My fuses' status is as follows
Jtagen ,SPIEN checked and
Boot Flash size=4096 words start address=$1F000
SUT_CKSEL :Full Swing Oscillator; Start-up time: 16K CK + 65 ms; Crystal Osc.; slowly rising power
Brown out detection disabled and my clock generator is 8003456 when I read.
No other fuses are programmed.
My build details :
Also request to burn and run on your stk600 in Atmega2560 to find out to deduce where/what is problem .
If it runs fine on yor side then there's prob in my stk600.
Code:
Build started 16.10.2011 at 22:24:54
avr-gcc -mmcu=atmega2560 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -O0
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Braking.o -MF dep/Braking.o.d -c ../Braking.c
In file included from ../Braking.c:2:
c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h:90:3: warning: #warning "Compiler optimizations disabled; functions
from <util/delay.h> won't work as designed"
../Braking.c:5:1: warning: "F_CPU" redefined
<command-line>: warning: this is the location of the previous definition
avr-gcc -mmcu=atmega2560 -Wl,-Map=Braking.map Braking.o -o Braking.elf
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature Braking.elf Braking.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ihex
Braking.elf Braking.eep || exit 0
avr-objdump -h -S Braking.elf > Braking.lss
AVR Memory Usage
----------------
Device: atmega2560
Program: 384 bytes (0.1% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
Build succeeded with 3 Warnings...
My code goes as below taken from tutorial on this site
Code:
#include <avr/io.h>
#include <util/delay.h>
#define F_CPU 8003456
#define USART_BAUDRATE 9600
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)
int main (void)
{
char ReceivedByte;
UCSR0B |= (1 << RXEN0) | (1 << TXEN0); // Turn on the transmission and reception circuitry
UCSR0C |= (1 << UCSZ00) | (1 << UCSZ01); // Use 8-bit character sizes
UBRR0H = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value into the high byte of the UBRR register
UBRR0L = BAUD_PRESCALE; // Load lower 8-bits of the baud rate value into the low byte of the UBRR register
for (;;) // Loop forever
{
while ((UCSR0A & (1 << RXC0)) == 0) {}; // Do nothing until data have been received and is ready to be read from UDR
ReceivedByte = UDR0; // Fetch the received byte value into the variable "ByteReceived"
while ((UCSR0A & (1 << UDRE0)) == 0) {}; // Do nothing until UDR is ready for more data to be written to it
UDR0 = ReceivedByte; // Echo back the received byte back to the computer
}
}
Any help will be greatly appreciated
Thanks and regards ,
NIkhil |