ATmega2560 SPI SS' pin

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

Dear avrfreaks,

During my current project and after ordering the PCB I red one think that I never red before. In the datasheet of ATmega2560, SPI unit it says that in Master SPI mode if the SS' pin is used as a digital input, then this must be held in high level.

In my design I am using the SS pin as a digital input with internal pull up enable. In this input there is a button connected. So when the button is pressed, low level appears in the SS' pin.

My question is if I have to switch to another unused digital pin or I will not have problems using the SS' pin as a digital input and the SPI in master mode. ????

Thank you.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

The ATmega2560 has got many GPIO pins.
You must choose a different pin for your button.

If you do not, the SPI will go haywire.

You can of course use any of the four USARTs as an SPI Master. USARTs do not go haywire.

You can always use the SS pin as an output with no problems. It will even work ok as an input with pull-up until you press the button.

David.

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

Dear David,

Thank you very much for the complete reply.

Best regards,

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer