Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

STK500/Mega168 basic setup

STK500/Mega168 basic setup

2007-02-20 by codsniper_net

Hi all, we are a student group working on a project where we need the
ATMega168 microprocessor and could use some help setting it up.

We thought we had all the wireings and settings right from the start
but it seems like we cant program the chip.

Could anyone describe a step by step procedure for setting this up,
all the way from the settings on the STK500 board to the AVR Studio
settings.

This would be of great help.

Regards
Roger, Mats & Kristian

(Sry bout my bad english)

Re: STK500/Mega168 basic setup

2007-02-20 by codsniper_net

--- In AVR-Chat@yahoogroups.com, Don AE5K <don@...> wrote:
> Hi Roger, Mats & Kristian...
> 
> Your "bad english" is better than most native speakers ;-)
> 
> Getting out my little "cheat sheet" I have drawn the jumper
> configuration for the ATMega48/88/168 series...
> 
> 1. Jumper "Prog Ctrl" to "Port D"
> 
> 2. Jumper "Prog Data" to "Port B"
> 
> 3. Single wire jumper from BSEL-2 (pin toward power connector side) to
> PORT-C pin 3 labeled PC2
> 
> 4. Shorting jumpers on P-JUMP (two of them) ... place so they are
> parallel to the long edge of the STK500 board.  (hard to describe!)
> 
> 5. You should have shorting jumpers on VTARGET, RESET, XTAL1 and pins
> 1-2 of OSCSEL.
> 
> Use socket 3200A2 (green) for your chip.
> 
> In AVR Studio, besides setting the correct COM port, not much to set
> other than make sure you have the correct chip ATmega168 selected.
> 
> Hopefully that will get you going.  All this information is buried in
> the help sections of the Studio program -- but it is rather disorganized
> and confusing even to one who has used it many times.
> 
> The ATMega168 (and its smaller brothers) are very neat microcontrollers!
> 
> Best of luck,
> 
> Don
>

Thank you so much Don for that :)
Yea we have tryed all kinds of books and help files, but thats about a
million pages to go trough. Thats why we thought about joining this
group and ask.

We got it to run with AVR Studio now but no luck in the CodeVisionAVR
program. Can even read the signature file in the last program. Just
says we dont have power supply or the chip is broken.
What are the main difference between those two programs, do we really
need it or can we use something else?

Again, thx

Re: [AVR-Chat] STK500/Mega168 basic setup

2007-02-20 by Jim Wagner

The instructions that come with the STK500 (they are buried
in "AVR Studio Help") do a pretty good job of explaining
what you need to do.

Jim

On Tue, 20 Feb 2007 08:17:35 -0000
 "codsniper_net" <codsniper_net@yahoo.com> wrote:
> Hi all, we are a student group working on a project where
> we need the
> ATMega168 microprocessor and could use some help setting
> it up.
> 
> We thought we had all the wireings and settings right
> from the start
> but it seems like we cant program the chip.
> 
> Could anyone describe a step by step procedure for
> setting this up,
> all the way from the settings on the STK500 board to the
> AVR Studio
> settings.
> 
> This would be of great help.
> 
> Regards
> Roger, Mats & Kristian
> 
> (Sry bout my bad english)
> 

---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

Re: [AVR-Chat] STK500/Mega168 basic setup

2007-02-20 by Don AE5K

codsniper_net wrote, On 02/20/2007 02:17 AM:
> Hi all, we are a student group working on a project where we need the
> ATMega168 microprocessor and could use some help setting it up.
> 
> We thought we had all the wireings and settings right from the start
> but it seems like we cant program the chip.
> 
> Could anyone describe a step by step procedure for setting this up,
> all the way from the settings on the STK500 board to the AVR Studio
> settings.
> 
> This would be of great help.
> 
> Regards
> Roger, Mats & Kristian
> 
> (Sry bout my bad english)

Hi Roger, Mats & Kristian...

Your "bad english" is better than most native speakers ;-)

Getting out my little "cheat sheet" I have drawn the jumper
configuration for the ATMega48/88/168 series...

1. Jumper "Prog Ctrl" to "Port D"

2. Jumper "Prog Data" to "Port B"

3. Single wire jumper from BSEL-2 (pin toward power connector side) to
PORT-C pin 3 labeled PC2

4. Shorting jumpers on P-JUMP (two of them) ... place so they are
parallel to the long edge of the STK500 board.  (hard to describe!)

5. You should have shorting jumpers on VTARGET, RESET, XTAL1 and pins
1-2 of OSCSEL.

Use socket 3200A2 (green) for your chip.

In AVR Studio, besides setting the correct COM port, not much to set
other than make sure you have the correct chip ATmega168 selected.

Hopefully that will get you going.  All this information is buried in
the help sections of the Studio program -- but it is rather disorganized
and confusing even to one who has used it many times.

The ATMega168 (and its smaller brothers) are very neat microcontrollers!

Best of luck,

Don

STK500/Mega168 RS232 problems

2007-09-01 by Ricardo Callejo

Hi everyone.

I follow AVRSTUDIO HELP to configure STK500 with ATMEGA168.

I flashed some simple programs working with LEDs, switches, timers to verify
the system. 

I find troubles when i work with the UART.

I wrote a simple code that works fine with other micros like AT90S4433 or
ATMEGA163, but with ATMEGA168 the program echoes strange chars.

 

I am using cvavr 

 

#include <mega168.h>

 

// Standard Input/Output functions

#include <stdio.h>

 

// Declare your global variables here

 

void main(void)  {

// Declare your local variables here  

char k;

            

// The other setting were deleted 

///  PORTs, TIMERs, ADC, etc.

/// ....

 

// USART initialization

// Communication Parameters: 8 Data, 1 Stop, No Parity

// USART Receiver: On

// USART Transmitter: On

// USART0 Mode: Asynchronous

// USART Baud rate: 19200

UCSR0A=0x00;

UCSR0B=0x18;

UCSR0C=0x06;

UBRR0H=0x00;

UBRR0L=0x0B;

 

while (1)  {

            

        /* receive the character */

        k = getchar();

        /* and echo it back */

        putchar(k);

};

}

 

What's wrong?

 

Ricardo Callejo

SURbyte SRL

San Martin 952

(9000) Comodoro Rivadavia

Chubut - Argentina

 

  _____  

De: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] En nombre de
Don AE5K
Enviado el: martes, 20 de febrero de 2007 11:38
Para: AVR-Chat@yahoogroups.com
Asunto: Re: [AVR-Chat] STK500/Mega168 basic setup

 

codsniper_net wrote, On 02/20/2007 02:17 AM:
> Hi all, we are a student group working on a project where we need the
> ATMega168 microprocessor and could use some help setting it up.
> 
> We thought we had all the wireings and settings right from the start
> but it seems like we cant program the chip.
> 
> Could anyone describe a step by step procedure for setting this up,
> all the way from the settings on the STK500 board to the AVR Studio
> settings.
> 
> This would be of great help.
> 
> Regards
> Roger, Mats & Kristian
> 
> (Sry bout my bad english)

Hi Roger, Mats & Kristian...

Your "bad english" is better than most native speakers ;-)

Getting out my little "cheat sheet" I have drawn the jumper
configuration for the ATMega48/88/168 series...

1. Jumper "Prog Ctrl" to "Port D"

2. Jumper "Prog Data" to "Port B"

3. Single wire jumper from BSEL-2 (pin toward power connector side) to
PORT-C pin 3 labeled PC2

4. Shorting jumpers on P-JUMP (two of them) ... place so they are
parallel to the long edge of the STK500 board. (hard to describe!)

5. You should have shorting jumpers on VTARGET, RESET, XTAL1 and pins
1-2 of OSCSEL.

Use socket 3200A2 (green) for your chip.

In AVR Studio, besides setting the correct COM port, not much to set
other than make sure you have the correct chip ATmega168 selected.

Hopefully that will get you going. All this information is buried in
the help sections of the Studio program -- but it is rather disorganized
and confusing even to one who has used it many times.

The ATMega168 (and its smaller brothers) are very neat microcontrollers!

Best of luck,

Don

 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] STK500/Mega168 RS232 problems

2007-09-01 by Jim Wagner

Ricardo -

Odds are your baud rate is not correct. Either the
processor clock is not what you think it is, or you are
putting an incorrect value into the baud rate generator.

Jim



On Sat, 1 Sep 2007 10:57:25 -0300
 "Ricardo Callejo" <surbyte@speedy.com.ar> wrote:
> Hi everyone.
> 
> I follow AVRSTUDIO HELP to configure STK500 with
> ATMEGA168.
> 
> I flashed some simple programs working with LEDs,
> switches, timers to verify
> the system. 
> 
> I find troubles when i work with the UART.
> 
> I wrote a simple code that works fine with other micros
> like AT90S4433 or
> ATMEGA163, but with ATMEGA168 the program echoes strange
> chars.
> 
>  
> 
> I am using cvavr 
> 
>  
> 
> #include <mega168.h>
> 
>  
> 
> // Standard Input/Output functions
> 
> #include <stdio.h>
> 
>  
> 
> // Declare your global variables here
> 
>  
> 
> void main(void)  {
> 
> // Declare your local variables here  
> 
> char k;
> 
>             
> 
> // The other setting were deleted 
> 
> ///  PORTs, TIMERs, ADC, etc.
> 
> /// ....
> 
>  
> 
> // USART initialization
> 
> // Communication Parameters: 8 Data, 1 Stop, No Parity
> 
> // USART Receiver: On
> 
> // USART Transmitter: On
> 
> // USART0 Mode: Asynchronous
> 
> // USART Baud rate: 19200
> 
> UCSR0A=0x00;
> 
> UCSR0B=0x18;
> 
> UCSR0C=0x06;
> 
> UBRR0H=0x00;
> 
> UBRR0L=0x0B;
> 
>  
> 
> while (1)  {
> 
>             
> 
>         /* receive the character */
> 
>         k = getchar();
> 
>         /* and echo it back */
> 
>         putchar(k);
> 
> };
> 
> }
> 
>  
> 
> What's wrong?
> 
>  
> 
> Ricardo Callejo
> 
> SURbyte SRL
> 
> San Martin 952
> 
> (9000) Comodoro Rivadavia
> 
> Chubut - Argentina
> 

---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

RE: [AVR-Chat] STK500/Mega168 RS232 problems - Solution

2007-09-01 by Ricardo Callejo

Okay Jim, i found my problem. Suddenly i changed the baud rate to 8MHz and
the programs started to run with any baud rate i selected.

When i try to think what was happening, i remembered that atmel ships micros
programmed with the internal clock.

I checked the fuses and eureka!!!

 

 

ON page 28 doc2545.pdf

 

7.2 Clock sources

 

7.2.1 Default Clock Source

 

The device is shipped with internal RC oscillator at 8.0MHz and with the
fuse CKDIV8 programmed,

resulting in 1.0MHz system clock. The startup time is set to maximum and
time-out

period enabled. (CKSEL = "0010", SUT = "10", CKDIV8 = "0"). The default
setting ensures that

all users can make their desired clock source setting using any available
programming interface.

 

Thanks.

 

Ricardo Callejo

SURbyte SRL

San Martin 952

(9000) Comodoro Rivadavia

Chubut – Argentina

 

 

  _____  

De: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] En nombre de
Jim Wagner
Enviado el: sábado, 01 de septiembre de 2007 12:05
Para: AVR-Chat@yahoogroups.com
Asunto: Re: [AVR-Chat] STK500/Mega168 RS232 problems

 

Ricardo -

Odds are your baud rate is not correct. Either the
processor clock is not what you think it is, or you are
putting an incorrect value into the baud rate generator.

Jim

On Sat, 1 Sep 2007 10:57:25 -0300
"Ricardo Callejo" <surbyte@speedy. <mailto:surbyte%40speedy.com.ar> com.ar>
wrote:
> Hi everyone.
> 
> I follow AVRSTUDIO HELP to configure STK500 with
> ATMEGA168.
> 
> I flashed some simple programs working with LEDs,
> switches, timers to verify
> the system. 
> 
> I find troubles when i work with the UART.
> 
> I wrote a simple code that works fine with other micros
> like AT90S4433 or
> ATMEGA163, but with ATMEGA168 the program echoes strange
> chars.
> 
> 
> 
> I am using cvavr 
> 
> 
> 
> #include <mega168.h>
> 
> 
> 
> // Standard Input/Output functions
> 
> #include <stdio.h>
> 
> 
> 
> // Declare your global variables here
> 
> 
> 
> void main(void) {
> 
> // Declare your local variables here 
> 
> char k;
> 
> 
> 
> // The other setting were deleted 
> 
> /// PORTs, TIMERs, ADC, etc.
> 
> /// ....
> 
> 
> 
> // USART initialization
> 
> // Communication Parameters: 8 Data, 1 Stop, No Parity
> 
> // USART Receiver: On
> 
> // USART Transmitter: On
> 
> // USART0 Mode: Asynchronous
> 
> // USART Baud rate: 19200
> 
> UCSR0A=0x00;
> 
> UCSR0B=0x18;
> 
> UCSR0C=0x06;
> 
> UBRR0H=0x00;
> 
> UBRR0L=0x0B;
> 
> 
> 
> while (1) {
> 
> 
> 
> /* receive the character */
> 
> k = getchar();
> 
> /* and echo it back */
> 
> putchar(k);
> 
> };
> 
> }
> 
> 
> 
> What's wrong?
> 
> 
> 
> Ricardo Callejo
> 
> SURbyte SRL
> 
> San Martin 952
> 
> (9000) Comodoro Rivadavia
> 
> Chubut - Argentina
> 

----------------------------------------------------------
The Think Different Store
http://www.thinkdif <http://www.thinkdifferentstore.com/> ferentstore.com/
For All Your Mac Gear
----------------------------------------------------------

 


  _____  

E-mail clasificado por el Idenfificador de Spam Inteligente. Para modificar
la categoría clasificada acceda a su webmail 


  _____  

Este mensaje ha sido verificado por el E-mail Protegido. Antivirus
Actualizado en 31/08/2007 / Versión: 5.1.00/5110 



[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.