ilmenator Posted March 2, 2013 Report Share Posted March 2, 2013 In order to make use of the 4 additional duo-color LEDs on my TPD module I need to activate one additional DOUT SR in the MB SEQv4. Why? The current MB SEQv4 firmware allows for a total of 24 SRs only. Of those, the first 16 are considered "direct" connections to LEDs, whereas the last 8 are forwarded to a LED matrix via the BLM_X module. With the TPD and a traditional BLM connected to Wilba's MBSEQ PCB, I need direct acces to 17 DOUT SRs, as there are 9 DOUT SRs on the TPD module. Electrically speaking, this should not be a problem, because in reality I have only connected 17 DOUT SRs - the matrixed ones are purely "virtual" in my case. However, I cannot only append another DOUT SR - the BLM_X-routines get in the way. Also, I was not successful in simply shifting the boundaries for direct- vs. matrix-handling in seq_led.c (and setting SEQ_LED_NUM_SR to 25 in seq_led.h), such that the first matrix-SR would be SR 18 / pin 137. Yes, I added mios32_config.h containing the line #define MIOS32_SRIO_NUM_SR 25 to the folder. Before I continue with this, I think it might be a good idea to ask for advice on how TK would like to handle this within the general framework of MBSEQv4. I got quite some feedback with respect to the TPD module and I could imagine a few more usecases which make the LED matrix display attractive. Thanks, ilmenator Quote Link to comment Share on other sites More sharing options...
TK. Posted March 2, 2013 Report Share Posted March 2, 2013 This new requirement for additional SRs will add a lot of complexity! I wish it would be possible to change the BLM_X assignments, but this would make all existing MBSEQ_HW.V4 files incompatible :sad: There is just no no clean solution for this... Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
ilmenator Posted March 2, 2013 Author Report Share Posted March 2, 2013 I'll send you a board once I have rev. 1.06 in my hands so you'll see how much fun this is. I'm sure we'll find a solution :yes: Quote Link to comment Share on other sites More sharing options...
ilmenator Posted March 4, 2013 Author Report Share Posted March 4, 2013 Well here is another idea how I thought this could be handled. In seq_led.c, LEDs are set according to SR/pin numbers as defined in the config file. The routines there differentiate between direct LEDs and those arranged in Wilba's 8x8 matrix. How about extending this in order to accomodate more SRs? E.g. ///////////////////////////////////////////////////////////////////////////// // Sets a LED, differs between LEDs directly connected to DOUT pins // (pin = 0..127) and LEDS which are connected to a 8x8 matrix (pin = 128..195) // (pin = 196...203) are connected to DOUT pins again ///////////////////////////////////////////////////////////////////////////// s32 SEQ_LED_PinSet(u32 pin, u32 value) { #ifdef MBSEQV4L if( pin < 64 ) return BLM_CHEAPO_DOUT_PinSet(pin, value); if( pin >= 128 && pin < 196 ) return BLM_X_LEDSet(pin-128, 0, value); #else if( pin < 128 ) return MIOS32_DOUT_PinSet(pin, value); if( pin < 196 ) return BLM_X_LEDSet(pin-128, 0, value); if( pin < 204 ) return MIOS32_DOUT_PinSet(pin-48, value); #endif return -1; // pin not available } My reasoning is that the 8 virtual SRs of pins 128...195 of Wilba's 8x8 matrix are connected to 2 real SRs in the chain. Hence, the subsequent real pins 196...204 must be shifted down the chain by 6 SRs (or 48 pins). I also modified SEQ_LED_SRSet and SEQ_LED_SRGet accordingly, however, it doesn't work that way. Now I wonder where my logic fails me? Thanks, ilmenator Quote Link to comment Share on other sites More sharing options...
TK. Posted March 4, 2013 Report Share Posted March 4, 2013 You've to increase the number of scanned SRs as well. This can be done in the mios32_config.h file: // increased number of SRs #define MIOS32_SRIO_NUM_SR 20 Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
ilmenator Posted March 4, 2013 Author Report Share Posted March 4, 2013 I assumed that mios32_config.h has to be located in the same folder as the makefile, so I had added a new one there - well, now I discovered it in mios32 and it works - only that the offset is actually the full eight SRs that are "virtual", not the difference between virtual and real SRs. So I need to subtract 64 instead of 48. Thanks! Quote Link to comment Share on other sites More sharing options...
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.