SPI Master Flag won't stay set Mega644

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

help!

 

Mega644P and I can't get SPI to work.

 

Seems that as soon as I set the MSTR bit in SPCR it clears itself on the next instruction.

 

I must be missing something, but what?

It's me again...

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

Read the instructions:

• Bit 4 – MSTR: Master/Slave Select
This bit selects Master SPI mode when written to one, and Slave SPI mode when written logic zero. If SS is
configured as an input and is driven low while MSTR is set, MSTR will be cleared,
and SPIF in SPSR will
become set. The user will then have to set MSTR to re-enable SPI Master mode.

 

Bodacious! I can now use my display!

 

Just means I swap my handset port with my 'future expansion port'. My excuse - wasn't planning on using SPI...

It's me again...

Last Edited: Sun. Mar 27, 2016 - 11:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This must be a record.
User discovers haywire-ability.
User reads data sheet.
User solves problem including posting message inside 12 minutes !
Well done, and best wishes.
David.