Problem with diy footcontroller

Started by ricothetroll, May 26, 2011, 04:54:46 PM

Previous topic - Next topic

ricothetroll

Hi,
I designed this footcontroller to be used with my band, in order to use Ableton Live as a multitrack, synchronised looping station.

Without entering the details, here is the principle :
http://img191.imageshack.us/i/midiold.pdf/

The leds display the state of Live's looper (play, record, overdub and stop). Tempo led flashes according to the tempo of the loops (controlled by a track in live).

Here are the schematic and the layout :
http://img19.imageshack.us/i/schematicx.png/
http://img844.imageshack.us/i/layoutjt.png/

I have breadboarded and tested both 16F628 (midi send and state leds), both work perfectly. The midi merge pic (16F88) come from this site :
http://www.ucapps.de/midimerger.html

When I tested the circuit, I first checked the DC rails, that were ok (all circuit gets 5V, with all IC sockets empty). Regulator didn't get hot.

I then put the 16F628 of the "midi note send". Then the PIC got very hot (couldn't keep my fingers on it), and so did the regulator. I the pulled the PIC out again and tested it on the breadboard : didn't work anymore. I the installed another programmed PIC after testing it on the breadboard : same thing.

I double checked my schematic, every solder on the PCB, eventual shortcuts, everything : all seems ok. I must admit that I don't know what to do now ! I might have done a mistake somewhere (maybe in the schematic) but I just don't find it !

Any clue would be appreciated !

Best regards.

Eric

PS : this is my first project with microcontrollers, I may not be aware of some important considerations !
PS2 : here are the programs I used (they worked when breadboarding) :

Midi note send :

//-----E/S-----

bit sw1 @ RA0;         //-----EntrĂ©es
bit sw2 @ RA1;
bit sw3 @ RA2;
bit sw4 @ RA3;
bit sw5 @ RA4;

//-----Variables-----

unsigned tempo_ar : 16;     //Variable de temporisation de l'antirebond

//-----Fonction antirebond-----

void antirebond(void)
{
for (tempo_ar=0;tempo_ar<10000;tempo_ar++); //antirebond de 20ms
}

//-----Fonctions principale-----

void main(void)
{
                            //-----Ports config-----
PORTA = 0x00;               // Clear ports
PORTB = 0x00;
CMCON = 0x07;               //Turn comparators off and enable pins
                            //for I/O functions
TRISA = 0b00011111;         //RA0-4 are in, RA5-7 are out
TRISB = 0b00000010;         //PORTB is out excepted RB1

                       //-----USART config-----
STATUS.5 = 1;          //zap to bank1
SPBRG = 0x27;          // init BRG 31250 bauds at 20MHz
TXSTA = 0b00100100;
STATUS.5 = 0;          //Come back to bank0
RCSTA = 0b10010000;


for (;;)                    //read midi byte
{
if (sw1 == 1)
{
TXREG = 0x8F;       //Send Note Channel Number
while (PIR1.4 == 0) //Wait until note is transmitted
{nop();}
TXREG = 0x01;       //Send Note Key
while (PIR1.4 == 0)
{nop();}
TXREG = 0x01;       //Send Note Velocity
while (PIR1.4 == 0)
{nop();}
while (sw1 == 1)    //Wait until switch is released
{nop();}
antirebond();
}
if (sw2 == 1)
{
TXREG = 0x8F;       //Send Note Channel Number
while (PIR1.4 == 0) //Wait until note is transmitted
{nop();}
TXREG = 0x02;       //Send Note Key
while (PIR1.4 == 0)
{nop();}
TXREG = 0x01;       //Send Note Velocity
while (PIR1.4 == 0)
{nop();}
while (sw2 == 1)    //Wait until switch is released
{nop();}
antirebond();
}
if (sw3 == 1)
{
TXREG = 0x8F;       //Send Note Channel Number
while (PIR1.4 == 0) //Wait until note is transmitted
{nop();}
TXREG = 0x00;       //Send Note Key
while (PIR1.4 == 0)
{nop();}
TXREG = 0x01;       //Send Note Velocity
while (PIR1.4 == 0)
{nop();}
while (sw3 == 1)    //Wait until switch is released
{nop();}
antirebond();
}
if (sw4 == 1)
{
TXREG = 0x8F;       //Send Note Channel Number
while (PIR1.4 == 0) //Wait until note is transmitted
{nop();}
TXREG = 0x04;       //Send Note Key
while (PIR1.4 == 0)
{nop();}
TXREG = 0x01;       //Send Note Velocity
while (PIR1.4 == 0)
{nop();}
while (sw4 == 1)    //Wait until switch is released
{nop();}
antirebond();
}
if (sw5 == 1)
{
TXREG = 0x8F;       //Send Note Channel Number
while (PIR1.4 == 0) //Wait until note is transmitted
{nop();}
TXREG = 0x05;       //Send Note Key
while (PIR1.4 == 0)
{nop();}
TXREG = 0x01;       //Send Note Velocity
while (PIR1.4 == 0)
{nop();}
while (sw5 == 1)    //Wait until switch is released
{nop();}
antirebond();
}
}
}


Looper state leds :

//-----E/S-----

bit tempo_led @ RB3;   //-----Sortie
bit stop_led @ RB0;
bit rec_led @ RB5;
bit play_led @ RB6;
bit overdub_led @ RB7;

//-----Variables-----

unsigned tempo_metro : 16;  //Variable de temporisation pour le metronome
char chan @ 0x20;           //Midi Channel
char key @ 0x21;            //Midi Key
char vel @ 0x22;            //Midi Velocity

//-----Fonctions principale-----

void main(void)
{
                            //-----Ports config-----
PORTA = 0x00;               // Clear ports
PORTB = 0x00;
CMCON = 0x07;               //Turn comparators off and enable pins
                            //for I/O functions
TRISA = 0b00011111;         //RA0-4 are in, RA5-7 are out
TRISB = 0b00000010;         //PORTB is out excepted RB1
INTCON.5=0;

                       //-----USART config-----
STATUS.5 = 1;          //zap to bank1
SPBRG = 0x07;          // init BRG 31250 bauds at 4MHz
TXSTA = 0b00100100;
STATUS.5 = 0;          //Come back to bank0
RCSTA = 0b10010000;

for (;;)                    //read midi byte
{
while (PIR1.5 == 0)     //Read received note channel number
{nop();}
chan = RCREG;
while (PIR1.5 == 0)     //Read received note key
{nop();}
key = RCREG;
while (PIR1.5 == 0)     //Read received note velocity
{nop();}
vel = RCREG;

if (key == 0x01)        //Looper in STOP mode
{
stop_led = 1;
play_led = 0;
rec_led = 0;
overdub_led = 0;
}
if (key == 0x02)        //Looper in PLAY mode
{
stop_led = 0;
play_led = 1;
rec_led = 0;
overdub_led = 0;
}
if (key == 0x03)        //Looper in REC mode
{
stop_led = 0;
play_led = 0;
rec_led = 1;
overdub_led = 0;
}
if (key == 0x04)        //Looper in OVERDUB mode
{
stop_led = 0;
play_led = 0;
rec_led = 0;
overdub_led = 1;
}
if (key == 0x05)        //Metronom note received
{
if (chan == 0x90) {tempo_led = 1;}
if (chan == 0x80) {tempo_led = 0;}
}
}
}

Hides-His-Eyes

There's no command for "fry pic"; your problem is on the board somewhere.

pjwhite

Check IC1 pin 8 for a short to ground.  Use an ohmmeter.  The trace runs very close to ground in at least one place that I see, where it would be very easy to have a solder short there (near U$1 pin 7).

Trying to drive a grounded output pin high could very well cause the excess heat and kill the IC.

ricothetroll

Hi,
Thanx for your answers !

QuoteThere's no command for "fry pic"; your problem is on the board somewhere.

I know !  :) I just gave the code for eventually interrested people.

I found at least one mistake : I used a wrong pinout for the 16F88 (I'm such an @$$hole, I know...). So I'll etch another board anyway. I'll also remove the optional connexions for unused pins, and try to group wire terminals more.

To be continued....

Best regards.

Eric