Skip to content

Board Configuration In Utils.ino

Autohome2 edited this page Oct 3, 2017 · 5 revisions

Board Configuration in Utils.ino

The firmware looks up the selected board type in utils to determine what IO ports are allocated to what MCU pin and which are not used. here is an extract from utils.ino for the mega2560 v0.01 config

case 1:   // mega2560 demo V0.001   
  pinOut[1] = 33; //     
  pinOut[2] = 35; //     
  pinOut[3] = 37; //    
  pinOut[4] = 39; //    
  pinOut[5] = 41; //    
  pinOut[6] = 43; //    
  pinOut[7] = 255; //    
  pinOut[8] = 255; //    
  pinOut[9] = 255; //     
  pinOut[10] = 255; //    
  pinOut[11] = 255; //    
  pinOut[12] = 255; //   
  pinOut[13] = 13; //    
  pinOut[14] = 255; //    
  pinOut[15] = 255; //   
  pinOut[16] = 255; //   

  pinIn[1] = 28;    
  pinIn[2] = 30;    
  pinIn[3] = 32;    
  pinIn[4] = 34;    
  pinIn[5] = 36;    
  pinIn[6] = 38;     
  pinIn[7] = 40;     
  pinIn[8] = 42;     
  pinIn[9] = 44;     
  pinIn[10] = 46;    
  pinIn[11] = 48;    
  pinIn[12] = 255;   
  pinIn[13] = 255;   
  pinIn[14] = 255;   
  pinIn[15] = 255;    
  pinIn[16] = 255;    
         
  pinAin[1] = A0;   
  pinAin[2] = A1;    
  pinAin[3] = A2;   
  pinAin[4] = A3;   
  pinAin[5] = 255;   
  pinAin[6] = 255;   
  pinAin[7] = 255;   
  pinAin[8] = 255;   
  pinAin[9] = 255;   
  pinAin[10] = 255;   
  pinAin[11] = 255;   
  pinAin[12] = 255;   
  pinAin[13] = 255;   
  pinAin[14] = 255;   
  pinAin[15] = 255;  
  pinAin[16] = 255;  

break;

If a port is unused then it should be set to 255. That port will now be "greyed out" when the list is dislayed in TunerStudio.
You do not need to use MCU pins in any particular order and you can leave out a port if you wish ,
eg is this case pinout[10] to pinout[12] are not used but pinout[13] is allocated an MCU pin.

DO NOT DUPLICATE MCU PIN ALLOCATIONS , to do so will result in the system not operating as you desire!

Clone this wiki locally