[Solved] Where are the m644 SPI pin defines ?!

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

I had to reinstall my XP OS and now a m644 pjt. that worked before the reinstall doesn't compile now !!? I get "undeclared" variable errors related to the 4 SPI port pins. I have a SPI.h file and the errors are all from there ( I have avr/io.h in that file too). I did a search function of the entire Winavr "AVR" folder for "MISO" and ONLY 26 MCUs come up as even having that ! WTH ?!!!

I have #1 & #2 from my sign. below and Winavr from sourceforge site, which I had to download since I didn't have a copy from the previous install. My Studio pjt. settings are correct.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

Last Edited: Tue. Apr 19, 2011 - 12:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What do you need MISO for? Do you bit-bang it?

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

It's a #define for the SPI module so I don't have to use "magic numbers".

Edit: Ok... I must have edited the avr/*.h file when I first did the project and put #defines in there and DIDN'T save it as a backup. It's the only thing I can think of now that I don't see, for example, #defines for the 2 TWI port pins in their iom64.h file. Funny that Atmel didn't define the peripheral port pins . I'll just put those #defines in my SPI.h file this time.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

Last Edited: Tue. Apr 19, 2011 - 12:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

indianajones11 wrote:
It's a #define for the SPI module so I don't have to use "magic numbers".
Again, what do you use MISO for? I can see that one would want SPDR,SPCR,SPSR. But why would you want to use MISO directly?

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

I use the names when doing the SPI_init(), for example ( it's better than PBx ).

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

indianajones11 wrote:
I use the names when doing the SPI_init(), for example.
OK. I see now. Yeah, I do not know why they are not defined.

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

Quote:

I must have edited the avr/*.h

So now you know why you should never edit system headers or libs. Even if you'd just upgraded to "Toolchain" (or the next WinAVR ;-)) you would have been bitten by doing this.

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

Quote:

Yeah, I do not know why they are not defined.

???
Sounds like a tempest in a teapot. I'd like to see a use of this "MISO" "pin define". For DDR work you'd need the port and the pin number (or mask). so you stll have to verify the correct port.

Are there any other alternate pin functions with "pin defines" on AVRs? OC1A, TXD0, INT0, PCINT4, XTAL1, ... ?

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

Cliff, you're right, and I already feel bitten ! :oops:

theusch wrote:
Are there any other alternate pin functions...
Lee, yeah it's minor enough for sure but even though hardly used in my code, I prefer it over magic numbers every time !

Jerome

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1