How To Reassign The MISO Pin?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
So I have a PCB with an LCD hooked up along with a 595 shift register. Unfortunately, when I designed the board I didn't realize that the LCD library used SPI, which on the Arduino Uno is pins 13-10. Therefore, the system overrides the pin 12 for the DHT and it returns nan.
The LCD library I used is here: https://playground.arduino.cc/Main/LiquidCrystal
I've tried modifying the pins_arduino.h on line 40 to set the MISO pin to something else. When I debug the MISO value with serial it prints the value I set it to, however it has no effect on the DHT (still returns nan).
So I'm in a sticky situation because literally every single pin is in use except for 0 and 1, and I've everything is kind of set because I've already made my PCB.
Is it even possible to change the MISO pin, if so, am I going about it the right way?
arduino spi arduino-uno
add a comment |Â
up vote
3
down vote
favorite
So I have a PCB with an LCD hooked up along with a 595 shift register. Unfortunately, when I designed the board I didn't realize that the LCD library used SPI, which on the Arduino Uno is pins 13-10. Therefore, the system overrides the pin 12 for the DHT and it returns nan.
The LCD library I used is here: https://playground.arduino.cc/Main/LiquidCrystal
I've tried modifying the pins_arduino.h on line 40 to set the MISO pin to something else. When I debug the MISO value with serial it prints the value I set it to, however it has no effect on the DHT (still returns nan).
So I'm in a sticky situation because literally every single pin is in use except for 0 and 1, and I've everything is kind of set because I've already made my PCB.
Is it even possible to change the MISO pin, if so, am I going about it the right way?
arduino spi arduino-uno
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
So I have a PCB with an LCD hooked up along with a 595 shift register. Unfortunately, when I designed the board I didn't realize that the LCD library used SPI, which on the Arduino Uno is pins 13-10. Therefore, the system overrides the pin 12 for the DHT and it returns nan.
The LCD library I used is here: https://playground.arduino.cc/Main/LiquidCrystal
I've tried modifying the pins_arduino.h on line 40 to set the MISO pin to something else. When I debug the MISO value with serial it prints the value I set it to, however it has no effect on the DHT (still returns nan).
So I'm in a sticky situation because literally every single pin is in use except for 0 and 1, and I've everything is kind of set because I've already made my PCB.
Is it even possible to change the MISO pin, if so, am I going about it the right way?
arduino spi arduino-uno
So I have a PCB with an LCD hooked up along with a 595 shift register. Unfortunately, when I designed the board I didn't realize that the LCD library used SPI, which on the Arduino Uno is pins 13-10. Therefore, the system overrides the pin 12 for the DHT and it returns nan.
The LCD library I used is here: https://playground.arduino.cc/Main/LiquidCrystal
I've tried modifying the pins_arduino.h on line 40 to set the MISO pin to something else. When I debug the MISO value with serial it prints the value I set it to, however it has no effect on the DHT (still returns nan).
So I'm in a sticky situation because literally every single pin is in use except for 0 and 1, and I've everything is kind of set because I've already made my PCB.
Is it even possible to change the MISO pin, if so, am I going about it the right way?
arduino spi arduino-uno
arduino spi arduino-uno
asked Aug 15 at 0:45
Matthew Inglis
1204
1204
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
How To Reassign The MISO Pin?
You can't. The ATmega328P used on the Arduino Uno only has one SPI peripheral, and its I/O pins cannot be reassigned.
As long as the SPI peripheral is active, pin PB4 (pin 12 on the Arduino Uno) is forced to act as an input, regardless of any other configuration on the device. This means that you will need to temporarily deactivate the SPI peripheral while you are communicating with the DHT sensor. The easiest way of doing this will be to call SPI.end()
before communicating with the sensor, then calling SPI.begin()
afterwards to return the SPI peripheral to its previous state.
Alternatively, you may want to consider using different hardware to reduce your pin congestion. In particular, if you can make the A4 and A5 pins available, you could replace the HD44780 display and DHT temperature sensor with I2C equivalents.
Also, if you reassign these pins, you need to take care that your hardware is okay with writing a bootloader through SPI. You may need additional logic for protection here.
â Simon Richter
Aug 15 at 2:56
@SimonRichter This is an Arduino board. The bootloader is already installed, and shouldn't need to be updated.
â duskwuff
Aug 15 at 3:49
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
How To Reassign The MISO Pin?
You can't. The ATmega328P used on the Arduino Uno only has one SPI peripheral, and its I/O pins cannot be reassigned.
As long as the SPI peripheral is active, pin PB4 (pin 12 on the Arduino Uno) is forced to act as an input, regardless of any other configuration on the device. This means that you will need to temporarily deactivate the SPI peripheral while you are communicating with the DHT sensor. The easiest way of doing this will be to call SPI.end()
before communicating with the sensor, then calling SPI.begin()
afterwards to return the SPI peripheral to its previous state.
Alternatively, you may want to consider using different hardware to reduce your pin congestion. In particular, if you can make the A4 and A5 pins available, you could replace the HD44780 display and DHT temperature sensor with I2C equivalents.
Also, if you reassign these pins, you need to take care that your hardware is okay with writing a bootloader through SPI. You may need additional logic for protection here.
â Simon Richter
Aug 15 at 2:56
@SimonRichter This is an Arduino board. The bootloader is already installed, and shouldn't need to be updated.
â duskwuff
Aug 15 at 3:49
add a comment |Â
up vote
5
down vote
accepted
How To Reassign The MISO Pin?
You can't. The ATmega328P used on the Arduino Uno only has one SPI peripheral, and its I/O pins cannot be reassigned.
As long as the SPI peripheral is active, pin PB4 (pin 12 on the Arduino Uno) is forced to act as an input, regardless of any other configuration on the device. This means that you will need to temporarily deactivate the SPI peripheral while you are communicating with the DHT sensor. The easiest way of doing this will be to call SPI.end()
before communicating with the sensor, then calling SPI.begin()
afterwards to return the SPI peripheral to its previous state.
Alternatively, you may want to consider using different hardware to reduce your pin congestion. In particular, if you can make the A4 and A5 pins available, you could replace the HD44780 display and DHT temperature sensor with I2C equivalents.
Also, if you reassign these pins, you need to take care that your hardware is okay with writing a bootloader through SPI. You may need additional logic for protection here.
â Simon Richter
Aug 15 at 2:56
@SimonRichter This is an Arduino board. The bootloader is already installed, and shouldn't need to be updated.
â duskwuff
Aug 15 at 3:49
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
How To Reassign The MISO Pin?
You can't. The ATmega328P used on the Arduino Uno only has one SPI peripheral, and its I/O pins cannot be reassigned.
As long as the SPI peripheral is active, pin PB4 (pin 12 on the Arduino Uno) is forced to act as an input, regardless of any other configuration on the device. This means that you will need to temporarily deactivate the SPI peripheral while you are communicating with the DHT sensor. The easiest way of doing this will be to call SPI.end()
before communicating with the sensor, then calling SPI.begin()
afterwards to return the SPI peripheral to its previous state.
Alternatively, you may want to consider using different hardware to reduce your pin congestion. In particular, if you can make the A4 and A5 pins available, you could replace the HD44780 display and DHT temperature sensor with I2C equivalents.
How To Reassign The MISO Pin?
You can't. The ATmega328P used on the Arduino Uno only has one SPI peripheral, and its I/O pins cannot be reassigned.
As long as the SPI peripheral is active, pin PB4 (pin 12 on the Arduino Uno) is forced to act as an input, regardless of any other configuration on the device. This means that you will need to temporarily deactivate the SPI peripheral while you are communicating with the DHT sensor. The easiest way of doing this will be to call SPI.end()
before communicating with the sensor, then calling SPI.begin()
afterwards to return the SPI peripheral to its previous state.
Alternatively, you may want to consider using different hardware to reduce your pin congestion. In particular, if you can make the A4 and A5 pins available, you could replace the HD44780 display and DHT temperature sensor with I2C equivalents.
edited Aug 15 at 1:15
answered Aug 15 at 1:03
duskwuff
15.4k32544
15.4k32544
Also, if you reassign these pins, you need to take care that your hardware is okay with writing a bootloader through SPI. You may need additional logic for protection here.
â Simon Richter
Aug 15 at 2:56
@SimonRichter This is an Arduino board. The bootloader is already installed, and shouldn't need to be updated.
â duskwuff
Aug 15 at 3:49
add a comment |Â
Also, if you reassign these pins, you need to take care that your hardware is okay with writing a bootloader through SPI. You may need additional logic for protection here.
â Simon Richter
Aug 15 at 2:56
@SimonRichter This is an Arduino board. The bootloader is already installed, and shouldn't need to be updated.
â duskwuff
Aug 15 at 3:49
Also, if you reassign these pins, you need to take care that your hardware is okay with writing a bootloader through SPI. You may need additional logic for protection here.
â Simon Richter
Aug 15 at 2:56
Also, if you reassign these pins, you need to take care that your hardware is okay with writing a bootloader through SPI. You may need additional logic for protection here.
â Simon Richter
Aug 15 at 2:56
@SimonRichter This is an Arduino board. The bootloader is already installed, and shouldn't need to be updated.
â duskwuff
Aug 15 at 3:49
@SimonRichter This is an Arduino board. The bootloader is already installed, and shouldn't need to be updated.
â duskwuff
Aug 15 at 3:49
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f391086%2fhow-to-reassign-the-miso-pin%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password