Have you ever seen the light at the end of a tunnel and just can’t quite get to the end? I am almost there with my project but still there is one last road block (I hope the last one).
Ok, on my quest to scan the buss on my Rodgers organ which must be done every 10us I have moved to the Core32, I have put the SRIO scanning into a tight loop so that the SR_Finish directly restarts the SRIO_SCAN. I use several mux pins (GPIO) that output between scan cycles. There are 4 scan cycles then it repeats. I have this working with J5A perfectly all the way to a pre-scalier of 8 which is getting my cycle time down to 17us. The final thing I needed to do is to add some additional GPIO outputs (4 more) in order to trigger the tone generators separately from the keyboards. Just a slight variation of what J5A pins are already doing.
Now the weirdness, once I started using J5B pins I get no Dout. The scanning is working fine but there is just no data going to the SR’s. Additionally when it does this the midi port will no longer allow MIOS studio to query it and I can’t download without cycling power and letting the bootloader take over. Din is still working, the J5 pins (all 8 of them) are working as expected but there is just no Dout.
I spent many hours putting rem statements in front of my code to see what was causing this. It came down to I can use EITHER the 4 pins of J5A OR 4 pins of J5B but NOT BOTH!! I could not find anything at all in my program that seemed wrong. Finally I changed the pre-scalier to 16 and boom, everything is working perfect (but 28us is too slow for my app). That proves to me that my code is ok. I was really hoping to eventually go to a pre-scalier of 4 in the final rev. (takes me to 12.5us cycle)
I was using the OD option and 1k pull up resistors, along the way I tried the PP and no resistors and got the Dout to work some with all 8 pins but it was delayed??? It took like around 3-4 ms from when I sent midi to when the Dout would output, all I had to do is rem out J5A pins or J5B pins and it would start working perfectly again??? Also I am using a scope to monitor the Dout to the SR’s to confirm there is no data outputting. I am using buffers on the clock, latch and data and I do have din and dout working down to pre-scalier 4 just not with 8 J5 pins.
I will attempt to use J19 pins to get around this but I thought perhaps TK or another expert user might be able to put some light into my problem. I AM SO CLOSE!
Here is the code In question, I put it in MIOS32_SRIO.C
…
static void MIOS32_SRIO_DMA_Callback(void)
{
// notify that new values have been transfered
srio_values_transfered = 1;
MIOS32_BOARD_J5_PinSet(muxctr , 0); //jm organ muxpin off (J5A)
MIOS32_BOARD_J5_PinSet(muxctr + 4 , 1); //jm keyboard mux pin on (J5B)
//latch DOUT registers by pulsing RCLK: 1->0->1
MIOS32_SPI_RC_PinSet(MIOS32_SRIO_SPI, MIOS32_SRIO_SPI_RC_PIN, 0); // spi, rc_pin, pin_value
//MIOS32_DELAY_Wait_uS(1);
MIOS32_SPI_RC_PinSet(MIOS32_SRIO_SPI, MIOS32_SRIO_SPI_RC_PIN, 1); // spi, rc_pin, pin_value
MIOS32_BOARD_J5_PinSet(muxctr + 4 , 0); //jm keyboard mux pin off (J5B)
//JM Mux counter
if ( ++muxctr >= 4 ) {
muxctr = 0;
}
//mux pin on
MIOS32_BOARD_J5_PinSet(muxctr , 1); //jm organ mux pin on (J5A)
…
Here are my MIOS32_Config.h def’s
#define MIOS32_DONT_SERVICE_SRIO_SCAN 1 //jm
#define MIOS32_SRIO_NUM_SR 8 //jm
#define MIOS32_DONT_USE_ENC 0 //jm
#define MIOS32_DONT_USE_DIN 0 //jm
#define MIOS32_DONT_USE_AIN 0 //jm
#define MIOS32_DONT_USE_COM 0 //jm
#define MIOS32_SRIO_OUTPUTS_OD 0 //jm
Thankx again for any help someone can provide,
Jmayes