How To Reassign The MISO Pin?

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question

























    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?










    share|improve this question























      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?










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 15 at 0:45









      Matthew Inglis

      1204




      1204




















          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.






          share|improve this answer






















          • 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










          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("schematics", function ()
          StackExchange.schematics.init();
          );
          , "cicuitlab");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "135"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          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.






          share|improve this answer






















          • 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














          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.






          share|improve this answer






















          • 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












          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.






          share|improve this answer















          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.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          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
















          • 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

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay