Pc_comm butterfly project .... please help.

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

I'm trying to get my butterfly to communicate with my pc. I have smileys book and thats one of the projects in there. First i tried typing everything up on my own. It did not build, so I copied the code from the cd but it still wont work. It seems that a ton of variables are undeclared. Some time ago the same code from the cd worked with older version of avr studio and win avr.

'UCSR0A' undeclared (first use in this function)
(Each undeclared identifier is reported only once
for each function it appears in.)
warning: control reaches end of non-void function
In function 'receiveChar':
'UDR0' undeclared (first use in this function)
warning: control reaches end of non-void function
In function 'sendChar':
'UDR0' undeclared (first use in this function)
'UCSR0A' undeclared (first use in this function)
In function 'USARTinit':
'UBRR0H' undeclared (first use in this function)
'UBRR0L' undeclared (first use in this function)
'UCSR0A' undeclared (first use in this function)
'U2X0' undeclared (first use in this function)
'UCSR0B' undeclared (first use in this function)
'RXEN0' undeclared (first use in this function)
'TXEN0' undeclared (first use in this function)
'RXCIE0' undeclared (first use in this function)
'UDRIE0' undeclared (first use in this function)

and so on is what i get. Do i need to include something except



Thanks in advance

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

For what it is worth, I always seem to get these errors when I forget to update my MCU in the makefile.

I also vaguely remember not getting the smilely macros makefile to work, but that was a while ago.

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

Smiley's stuff is built for a particular incarnation or reincarnation of GCC. IIRC the chip include files for the '169 were adjusted at some point to accommodate the change of USART to USART0 on the Mega169. So go back to that version, or tweach the changes out of your code. (One way is to #define all the names to names0)

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Page 18 from the book:

Quote:
Don’t get bogged down in all the installation choices given, just accept suggested
defaults so your installation will match this book. And, as an aside, by the time
you install all this software, the WinAVR and the AVRStudio will have new and
improved versions available on their web sites. DON’T USE THEM! This text is
based on the versions on the CD or on the SmileyMicros.com web site and using
the new and improved software may only confuse things. Of course, by the time
you finish this text, you will be encouraged to get the latest and greatest, by then
you’ll know all you need to use it wisely.

If you want to use a more recent version, you must translate the variable name into whatever they are called in the newer version.

The version used by the book is perfectly fine and once you finish the book you can upgrade with no problem.

Smiley