Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
naturephoenix
PostPosted: May 19, 2012 - 09:02 PM
Rookie


Joined: Mar 14, 2012
Posts: 27


I was working on a book "C Programming for
Microcontrollers Featuring ATMEL’s AVR Butterfly and the Free WinAVR Compiler",
and I failed on start Sad.

Actually all went good till I write the program
"Blinking LEDs – Your First C Program"
into butterfly and (but dont ask why) I plugged out the
battery (3V panasonic from Japan).

After I plugged in battery, and when I press/ move joystic upward I get on my display some weird text which rolls or spins in circle with high speed, so I cant really see with my eyes what does it say on display.Frequency is very high.

How to fix it, is that cuz I loaded this code into butterfly, or something else with battery?

Here's the code:
Code:

#include <avr/io.h>
#include <avr/delay.h>
int main (void)
{
// set PORTD for output
DDRD = 0xFF;
while(1)
{
      for(int i = 1; i <= 128; i = i*2)
   {
      PORTD = i;
      _delay_loop_2(30000);
   }
   for(int i = 128; i > 1; i -= i/2)
      {
         PORTD = i;
      _delay_loop_2(30000);
         
      }
   }
   return 1;
}

 
 View user's profile Send private message  
Reply with quote Back to top
smileymicros
PostPosted: May 20, 2012 - 01:43 AM
Raving lunatic


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.

You hold the joystick button pressed to the center and while it is pressed you insert the battery or if you are using an external battery you turn it on - while the button is pressed. Then you can release the button - but it must be pressed before you try to send the program to it. This button procedure sends out a series of question marks that the uploader needs to recognize that the Butterfly bootloader is ready to receive code.

The unreadable display is peculiar - has it been programmed before?

Smiley

_________________
FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
naturephoenix
PostPosted: May 20, 2012 - 07:31 AM
Rookie


Joined: Mar 14, 2012
Posts: 27


smileymicros wrote:


The unreadable display is peculiar - has it been programmed before?

Smiley


Yes,I programmed it with ""Blinking LEDs",
and after that things go bad but I repeat, only after I plugged out the "circle battery" which is placed on the board.

Display look's like it's scrolling some text with high speed.
 
 View user's profile Send private message  
Reply with quote Back to top
naturephoenix
PostPosted: May 20, 2012 - 08:59 AM
Rookie


Joined: Mar 14, 2012
Posts: 27


smileymicros wrote:
You hold the joystick button pressed to the center and while it is pressed you insert the battery or if you are using an external battery you turn it on - while the button is pressed. Then you can release the button - but it must be pressed before you try to send the program to it. This button procedure sends out a series of question marks that the uploader needs to recognize that the Butterfly bootloader is ready to receive code.

Smiley


I have done that with success but I had to set up butterfly in bootloader mode before.

Od cource now I can't get any of my modes, all I see
is that fast scrolling text.

Is it possible that is running the program
"blinking leds"?
 
 View user's profile Send private message  
Reply with quote Back to top
smileymicros
PostPosted: May 20, 2012 - 05:39 PM
Raving lunatic


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.

Quote:
Is it possible that is running the program
"blinking leds"?

If you loaded the blinking LED program then of course it could be running that program. Did you hook up the LEDs to see?

If you finish reading that chapter you'll see:
Quote:
NOTE: the Butterfly LCD dances like crazy with each LED pass, because some of the Port D pins are also tied to the LCD. It’s a bug in our design, but in the world of marketing it would be called a free bonus feature available exclusively to you for an unheard of low price if you act immediately. Will it harm the LCD? Probably not, but I don’t know for sure, so don’t leave Blinky running overnight.
Could this be what you are seeing?

Smiley

_________________
FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
naturephoenix
PostPosted: May 20, 2012 - 06:44 PM
Rookie


Joined: Mar 14, 2012
Posts: 27


smileymicros wrote:
Quote:
Is it possible that is running the program
"blinking leds"?

If you loaded the blinking LED program then of course it could be running that program. Did you hook up the LEDs to see?

If you finish reading that chapter you'll see:
Quote:
NOTE: the Butterfly LCD dances like crazy with each LED pass, because some of the Port D pins are also tied to the LCD. It’s a bug in our design, but in the world of marketing it would be called a free bonus feature available exclusively to you for an unheard of low price if you act immediately. Will it harm the LCD? Probably not, but I don’t know for sure, so don’t leave Blinky running overnight.
Could this be what you are seeing?

Smiley


Yes it's that probably, and I manage to open AVR prog,
So can you tell me how to remove blinky program, or I have to overwrite it with some program who does nutin

I just want to see default "AVR Butterfly screen" and to be able again to open all modes which comes into it

thx
 
 View user's profile Send private message  
Reply with quote Back to top
smileymicros
PostPosted: May 20, 2012 - 06:53 PM
Raving lunatic


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.

You have to reload the original AVR Butterfly application. It is also in my downloads section and you install the hex file just like you installed the Blinky file.

Smiley

_________________
FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
naturephoenix
PostPosted: May 20, 2012 - 07:21 PM
Rookie


Joined: Mar 14, 2012
Posts: 27


smileymicros wrote:
You have to reload the original AVR Butterfly application. It is also in my downloads section and you install the hex file just like you installed the Blinky file.

Smiley


Thank you, It works!
And does this mean that any time I load some program into butterfly I will lose the original butterfly application.?

What If I place myprogram.c into the bf_gcc folder(original avr butterfly aplication folder)
and then I load the original .hex

Don't mind, but if I countinue to read a book, and I will for sure, u can expect more dumb questions Razz
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: May 21, 2012 - 10:59 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62345
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

And does this mean that any time I load some program into butterfly I will lose the original butterfly application.?


Yes.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits