Hi, i’m still trying to do mixed DIN/DOUT using J5.
So i used J5_IO_Init(0x0f) in my code (J5 0-3 for DIN and J5 4-7 for DOUT).
The DOUT part of the circuit works (i’ve connected 4 leds, with a 470 ohm resistor, and leds switch on-off correctly, based on my midi commands to the core).
But for the DIN part, i have connected 10k resistors to J5 0-3, and also connected the switches (which, as for the little i can understand, when in ON state they send those pins to ground).
I’ve also implemented this code in AIN_NotifyChange (based on some earlier info in this thread) :
valore=0;
if (pin_value>512) valore=1;
for (i=0; i<4; i++)
{
J5_IO_PinSet(i, valore);
}
MIOS_MIDI_TxBufferPut(192);
MIOS_MIDI_TxBufferPut(2);
(i wanted to generate a MIDI event to see, in MIOS Studio, if something happens when i press the button…)
But nothing happens..
Also, i’ve noticed that using a 10k resistor, as shown in the j5_din.pdf, voltage on the pins is 0.3V when the button is open, and, obviously, 0V when i press the button.. Is it correct that this small voltage variation could be catched in AIN_NotifyChange ?
What am i doing wrong ? I followed the schematics in j5_din.pdf (with the only exception that i’m using pins 4-7 for DOUT and 0-3 for DIN).
Also, in the init function i also have this code (copied from this thread), after the J5_IO_Init(0x0f) :
ADCON1 = 0x07;
TRISA &= 0xd0;
TRISE &= 0xf8;
I’ve tried to comment out these three instructions, but the device seems to be working in the same exact way. Are those instructions necessary, as i’m using the J5_IO_Init(0xF) ?
Thanks in advance.
Have a nice time