Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

disable SPI? Mega162

disable SPI? Mega162

2010-08-09 by Jeff Blaine

My SPI is working fine.  But I just want to use it for part of a startup routeene.  And then disable it so that the MOSI line is available for other uses.  

I did not see anything in the data sheet preventing this but that blasted MOSI line wants to stay high even after I disable the SPI via setting SPE=0.

Wondered if there is some other "trick" to turning the SPI module off.  Or maybe it's on until reset, once initalized?

I must be overlooking something simple.  Seems setting SPE low should disable the SPI.  And designating MOSI as an output should reenable it''s use as a standard I/O pin...

73/jeff/ac0c
www.ac0c.com


[Non-text portions of this message have been removed]

Re: [AVR-Chat] disable SPI? Mega162

2010-08-09 by John Samperi

At 12:41 PM 9/08/2010, you wrote:
>then disable it so that the MOSI line is available for other uses.

The SPI, all pins, is ALWAYS available regardless.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] disable SPI? Mega162

2010-08-09 by Jeff Blaine

John,

Sorry, I don't quite follow your meaning????

do you mean the pins on the SPI port are always dedicated to the SPI function?  

Or, is it that even when SPI is enabled, you can always directly write to those pins and affect their state (until an SPI operation reverses them, that is...)?

Thanks!

73/jeff/ac0c
www.ac0c.com
Show quoted textHide quoted text
From: John Samperi 
Sent: Sunday, August 08, 2010 9:44 PM
To: AVR-Chat@yahoogroups.com 
Subject: Re: [AVR-Chat] disable SPI? Mega162


  
At 12:41 PM 9/08/2010, you wrote:
>then disable it so that the MOSI line is available for other uses.

The SPI, all pins, is ALWAYS available regardless.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495 Fax (02) 9674-8745
Website http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************





[Non-text portions of this message have been removed]

Re: [AVR-Chat] disable SPI? Mega162

2010-08-09 by Jeff Blaine

John,

Never mind it.  I made a stupid mistake on the #define - had the wrong blasted pin.  

Thanks - our suggestion was not the answer - but it helped push my head to the answer and I'm most grateful for it.

73/jeff/ac0c
www.ac0c.com
Show quoted textHide quoted text
From: Jeff Blaine 
Sent: Sunday, August 08, 2010 10:16 PM
To: AVR-Chat@yahoogroups.com 
Subject: Re: [AVR-Chat] disable SPI? Mega162


  
John,

Sorry, I don't quite follow your meaning????

do you mean the pins on the SPI port are always dedicated to the SPI function? 

Or, is it that even when SPI is enabled, you can always directly write to those pins and affect their state (until an SPI operation reverses them, that is...)?

Thanks!

73/jeff/ac0c
www.ac0c.com

From: John Samperi 
Sent: Sunday, August 08, 2010 9:44 PM
To: AVR-Chat@yahoogroups.com 
Subject: Re: [AVR-Chat] disable SPI? Mega162

At 12:41 PM 9/08/2010, you wrote:
>then disable it so that the MOSI line is available for other uses.

The SPI, all pins, is ALWAYS available regardless.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495 Fax (02) 9674-8745
Website http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]

RE: [AVR-Chat] disable SPI? Mega162

2010-08-09 by Philippe Habib

This doesn't really answer your question, but have you thought of not using
the HW SPI and just bit banging the stuff you need for your startup?
Show quoted textHide quoted text
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Jeff Blaine
Sent: Sunday, August 08, 2010 7:42 PM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] disable SPI? Mega162

My SPI is working fine.  But I just want to use it for part of a startup
routeene.  And then disable it so that the MOSI line is available for other
uses.  

I did not see anything in the data sheet preventing this but that blasted
MOSI line wants to stay high even after I disable the SPI via setting SPE=0.

Wondered if there is some other "trick" to turning the SPI module off.  Or
maybe it's on until reset, once initalized?

I must be overlooking something simple.  Seems setting SPE low should
disable the SPI.  And designating MOSI as an output should reenable it''s
use as a standard I/O pin...

73/jeff/ac0c
www.ac0c.com


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

Re: [AVR-Chat] disable SPI? Mega162

2010-08-09 by John Samperi

At 01:16 PM 9/08/2010, you wrote:
>Sorry, I don't quite follow your meaning????

That's because I wasn't making any sense!! 2nd time today.

I'm a bit dyslectic today and read it as ISP.....

Glad you got it working anyway. :-)



Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.