2018年11月08日

Ports

original.jpg

schematic36.png

LaVoixskiHammond80mm1025_18.png

LaVoixskiHammondMCU100mm1025_18.png

#define LEDorg 44 // LED on D44 Switching the "Orange" LED
#define LEDorg_ON (CORE_PIN44_PORTSET = (1<<22))
#define LEDorg_OFF (CORE_PIN44_PORTCLEAR = (1<<22))

#define LED2org 45 // LED on D45 Switching the "Orange" LED
#define LED2org_ON (CORE_PIN45_PORTSET = (1<<23))
#define LED2org_OFF (CORE_PIN45_PORTCLEAR = (1<<23))

#define LEDlav 48 // Switching the "Purple" LED
#define LEDlav_ON (CORE_PIN48_PORTSET = (1<<9))
#define LEDlav_OFF (CORE_PIN48_PORTCLEAR = (1<<9))

#define LED2lav 49 // Switching the "Purple" LED
#define LED2lav_ON (CORE_PIN49_PORTSET = (1<<4))
#define LED2lav_OFF (CORE_PIN49_PORTCLEAR = (1<<4))


#define LEDvol 28 // LED on D28 Switching the "LED in Eyeball"
#define LEDvol_ON (CORE_PIN28_PORTSET = (1<<16))
#define LEDvol_OFF (CORE_PIN28_PORTCLEAR = (1<<16))

#define LEDvol2 13 // Switching the BIAS
#define LEDvol2_ON (CORE_PIN13_PORTSET = (1<<5))
#define LEDvol2_OFF (CORE_PIN13_PORTCLEAR = (1<<5))

#define LEDvol3 2 // Switching the Audio Levels
#define LEDvol3_ON (CORE_PIN2_PORTSET = (1<<0))
#define LEDvol3_OFF (CORE_PIN2_PORTCLEAR = (1<<0))

#define LED0 0 // Switching the Sequence Start Indicator
#define LED0_ON (CORE_PIN0_PORTSET = (16<<0))
#define LED0_OFF (CORE_PIN0_PORTCLEAR = (16<<0))

#define CS01 29
#define CS01_ON (CORE_PIN29_PORTSET = (1<<18))
#define CS01_OFF (CORE_PIN29_PORTCLEAR = (1<<18))

#define LDAC01 33
#define LDAC01_ON (CORE_PIN33_PORTSET = (1<<24))
#define LDAC01_OFF (CORE_PIN33_PORTCLEAR = (1<<24))

#define CS02 31
#define CS02_ON (CORE_PIN31_PORTSET = (1<<10))
#define CS02_OFF (CORE_PIN31_PORTCLEAR = (1<<10))

#define LDAC02 14
#define LDAC02_ON (CORE_PIN14_PORTSET = (1<<1))
#define LDAC02_OFF (CORE_PIN14_PORTCLEAR = (1<<1))

#define CS03 47
#define CS03_ON (CORE_PIN47_PORTSET = (1<<8))
#define CS03_OFF (CORE_PIN47_PORTCLEAR = (1<<8))

#define LDAC03 46
#define LDAC03_ON (CORE_PIN46_PORTSET = (1<<21))
#define LDAC03_OFF (CORE_PIN46_PORTCLEAR = (1<<21))

#define CS04 15
#define CS04_ON (CORE_PIN15_PORTSET = (1<<0))
#define CS04_OFF (CORE_PIN15_PORTCLEAR = (1<<0))

#define LDAC04 16
#define LDAC04_ON (CORE_PIN16_PORTSET = (1<<0))
#define LDAC04_OFF (CORE_PIN16_PORTCLEAR = (1<<0))

#define CS05 20
#define CS05_ON (CORE_PIN20_PORTSET = (1<<5))
#define CS05_OFF (CORE_PIN20_PORTCLEAR = (1<<5))

#define LDAC05 21
#define LDAC05_ON (CORE_PIN21_PORTSET = (1<<6))
#define LDAC05_OFF (CORE_PIN21_PORTCLEAR = (1<<6))


#define SCK01 30
#define SCK01_ON (CORE_PIN30_PORTSET = (1<<19))
#define SCK01_OFF (CORE_PIN30_PORTCLEAR = (1<<19))

#define SD01 32
#define SD01_ON (CORE_PIN32_PORTSET = (1<<11))
#define SD01_OFF (CORE_PIN32_PORTCLEAR = (1<<11))

//////////////////////////////////////////////////////////////////////////

reading = digitalReadFast(4); // Sequencer Start/Stop switch

if (reading == HIGH && previous == LOW && millis() - time2 > debounce) {
if(state4 == HIGH)
state4 = LOW;
else
state4 = HIGH;
time2 = millis();
}

digitalWriteFast(0, !state4); // Sequence Start/Stop indicator out
previous = reading;

////////////////////////////////////////////////////////////////////////////////

if(addr1a == 11 || addr1a == 13 || addr1a == 17 || addr1a == 21 || addr1a == 22 || addr1a == 25 || addr1a == 27 || addr1a == 28 || addr1a == 29){
LEDvol3_OFF;
}
else{
LEDvol3_ON;
}; //Driving MAX4603 SW01/03/04 level control

if(addr1a == 15 || addr1a == 30 || addr1a == 31){
LEDvol2_OFF;
}
else{
LEDvol2_ON;
}; //Driving MAX4603 SW02 bias control
// || addr1a == 32 pending

////////////////////////////////////////////////////////////////////////////

if((state==0) && (button_State3 == LOW)) // Check if cal switch (eye ball shape) is released
{
state=1;
timer=0;
}

/////////////////////////////////////////////////////////////////////////////

if ((vol_vd > 4)&&(vol_vd < 2048)) {LEDvol_ON;} else {LEDvol_OFF;} // LED (in the eye ball) "ON" if value in range
posted by Yasuski at 21:06| AudioElectronics