Lag Posted October 9, 2006 Report Posted October 9, 2006 Hello everybodyI experience some odd going on's with a midi switcher idea i want to build directly in an old tube guitar amplifier.The Design: I use a core + a improvised relay board based on the relay_example.pdf with the 74HC595 and the ULN2803. there are 8 relays and only one 74HC595 with one ULN2803 attached connected via a 5 pin cable to the core-pcb.The good thins: Everything seems to work fine from the start. the lcd flashes up. MIOS could be programmed and i was able to compile c applications and upload them into the pic to be greeted with nice characters in the display.The Problem: Beside i've got not very much knowledge about c the relays wont work the way they should. Using the code posted below i'm only able to get 2 relay-states. State 1: 11111111all 8 relays get poweredState 2: 10101010every second relay gets poweredThe very strange thing about this all is that it only depends on pin 0x07!!!0x07 = 1 --> above State 10x07 = 0 --> above State 2All other pins do nothing.As example in this code withevnt1=0x00 --> the relays are going in State 1evnt1=0x01 --> the relays are going in State 2-----------void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam{ //**On MIDI Recieve**// //only work if Program Change is received on channel 1 if( evnt0 == 0xc0) { //only work if Program Change 1,2 received if(evnt1 == 0x00) { //reset all pins MIOS_DOUT_PinSet(0x00, 0); MIOS_DOUT_PinSet(0x01, 0); MIOS_DOUT_PinSet(0x02, 0); MIOS_DOUT_PinSet(0x03, 0); MIOS_DOUT_PinSet(0x04, 0); MIOS_DOUT_PinSet(0x05, 0); MIOS_DOUT_PinSet(0x06, 0); MIOS_DOUT_PinSet(0x07, 1); //activate the recieved program change's pin to control the relay MIOS_DOUT_PinSet(evnt1, 1); } else if (evnt1 == 0x01) { MIOS_DOUT_PinSet(0x00, 1); MIOS_DOUT_PinSet(0x01, 1); MIOS_DOUT_PinSet(0x02, 1); MIOS_DOUT_PinSet(0x03, 1); MIOS_DOUT_PinSet(0x04, 1); MIOS_DOUT_PinSet(0x05, 1); MIOS_DOUT_PinSet(0x06, 1); MIOS_DOUT_PinSet(0x07, 0); } }}-----------Is it still a hardware problem i cannot find? i've checked my wirings several times. Or am I doing something wrong in the c code? it looks like there is only a little piece missing...thanks for any help or advice.gunnar Quote
Lag Posted October 10, 2006 Author Report Posted October 10, 2006 I found the solution to the problem on my own.Exchanging two wires (SCLK with RCLK) on the relay extension made the whole thing work. --> simply my fault ;-|Sorry for disturbing and thanks a lot to the inventor + friends for this wonderful project!greetzgunnar :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.