Yahoo Groups archive

AVR-Chat

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

Message

Re: Grr, steep learning curve!!

2008-04-21 by John

Paul,

I understand your desire to test it on real hardware.  I can not help
you much more with the SP12, as I do not have one.

However, as you are using Studio, you can set your target to Emulate
and run the program inside the emulator on the PC (without hooking up
to any hardware.)  The emulator works great for testing simple I/O
type programs, as you can manipulate the IO bits and watch the "soft"
port pins change in the emulator.

Once you have it working like you want in the emulator, then you can
switch out to real hardware.  This way, you are only debugging one
thing at a time.  Again, if the SP12 software fails to work, you can
also try the avrdude software.  I believe avrdude has much better
following and should (conceivably) be better supported.

(There are some peripherals that do not work on the emulator, the UART
is one of them.)

John

--- In AVR-Chat@yahoogroups.com, "Paul Sinclair" <paul@...> wrote:
>
>  Well, after spending hours trying to get something working I have
had to
> come crawling back.
> 
> The piece of code I have been trying to get to work is:
> 
>  
> 
> //----------------------------------------------------------------------
> 
> // Titel     : Beispiel LED an für myAVR-Board
> 
> //----------------------------------------------------------------------
> 
> // Funktion  : Schaltet alle 3 LEDs an
> 
> // Schaltung : PortB 0-2 an LEDs
> 
> //----------------------------------------------------------------------
> 
> // Prozessor : ATmega8/48/88/168
> 
> // Takt                  : 3.6864 MHz
> 
> // Sprache   : C
> 
> // Datum     : 02.12.2005
> 
> // Version   : 1.3
> 
> // Autor     : Dipl. Ing. Päd. Alexander Huwaldt
> 
> //----------------------------------------------------------------------
> 
> #define                F_CPU 3686400 // Taktfrequenz des myAVR-Boards
> 
> #include               <avr\io.h>                           // AVR
Register
> und Konstantendefinitionen
> 
> //----------------------------------------------------------------------
> 
> main ()
> 
> {
> 
>                 DDRB=0xFF;                                      
//PortB auf
> Ausgang konfigurieren
> 
>                 do
> 
>                 {
> 
>                                 PORTB=0xFF;     // PortB High, LEDs on
> 
>                 } while (true);                    // Mainloop
> 
> }
> 
> //----------------------------------------------------------------------
> 
>  
> 
> I have been using avr studio, baisically I started a new project,
and pasted
> that code in and built it. After having to make some changes, due to the
> program saying that "true not initialized" I changed the code from:
> 
>  
> 
>                 do
> 
>                 {
> 
>                                 PORTB=0xFF;     // PortB High, LEDs on
> 
>                 } while (true);                    // Mainloop
> 
>  
> 
>  
> 
>  
> 
> To
> 
>  
> 
>  
> 
>  
> 
>                 Int x;
> 
> X = 1;
> 
> While (x == 1)
> 
>                 {
> 
>                                 PORTB=0xFF;     // PortB High, LEDs on
> 
>                 }                              // Mainloop
> 
>  
> 
>  
> 
>  
> 
> It built grand then, but when I took the hex file, and used the sp12
program
> to program it, it said:
> 
>  
> 
> H:\Documents and Settings\Paul>sp12 -p -f C:/avr/test.hex
> 
> SP12 version 2.0.7 performing init...
> 
> Path to _sp12rc and _sp12dev: H:\Program Files\SP12_AVR\
> 
> Running in SP12 cable/dongle compatible mode.
> 
> Enabling AVR serial reading/programming...
> 
> The device code bytes 0,1,2: 0x1e, 0x93, 0x7 were read
> 
> from parallel port 0x378 and indicate the following:
> 
> You have connected an ATmega8
> 
> The device was made by Atmel
> 
>  
> 
> Writing 0000 (0, B00000000) to the parallel port data bits.
> 
>  
> 
>  
> 
>  
> 
> So im lost, nothing happened on the board, so I don't know if
anything has
> been programmed.
> 
> I have noticed it is very hard to find any decent tutorials aswell..
But I
> would like to be able to reliably program the device before wrecking
my head
> with code wondering why its not working.
> 
>  
> 
> It's probably time I got myself a proper development board, but I
don't have
> the money and I really just want to get started on these things,
this board
> has been sitting here for a while!
> 
>  
> 
>  
> 
> Thanks (once again)
> 
> Paul.
> 
>  
> 
> 
> 
> [Non-text portions of this message have been removed]
>

Attachments

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.