mess Posted July 1, 2006 Report Posted July 1, 2006 HiIs it possible to integrate the led matrix driver (from sidmatrix test)with the C scanmatrix example?I want to drive 64 leds and 32 buttons using a DINX1 and a DOUTX2Michaël Quote
DrBunsen Posted July 1, 2006 Report Posted July 1, 2006 You might find some helpful clues linked from the DrumStuff wiki page. Quote
mess Posted July 3, 2006 Author Report Posted July 3, 2006 I allready looked at that page but none of the links provide the combination of buttons and leds(correct me if I'm wrong ???)in the meantime I've build the button/led matrix with two DOUT registers for the leds and seperate DIN/DOUT registers for the button matrix (driven by sm_example code)so I just have to modify the SID ledmatrix example and add a C style header for the asm functions... Quote
mess Posted July 3, 2006 Author Report Posted July 3, 2006 I've managed to get this to work :)I'm using one dout to drive both matrices and a din/dout for buttons/ledsmodifications to scan matrix example:in main.c: ... //second shiftregister drives the leds #define LEDOUT 1 ... void LM_SetRow(){ MIOS_DOUT_SRSet(LEDOUT,ledtest[sm_col]); } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS before the shift register are loaded ///////////////////////////////////////////////////////////////////////////// void SR_Service_Prepare(void) __wparam { // call the Scan Matrix Driver SM_PrepareCol(); // call the Led Matrix Driver LM_SetRow(); } ... in sm_simple.asm: ... global _sm_button_column global _sm_button_row global _sm_button_value global _sm_col ;; import lables extern _SM_NotifyToggle ; ========================================================================== accessram udata ; (no access ram required, these variables can be located anywhere) _sm_button_column res 1 ; exported to C, therefore an "_" has been added _sm_button_row res 1 _sm_button_value res 1 _sm_col res 1 ... SM_PrepareCol ;; select next DOUT register ;; (current column + 1) & 0x07 SET_BSR sm_selected_column incf sm_selected_column, W, BANKED ; (* see note below) andlw 0x07 ;_sm_col is used by LM_SetRow() movwf _sm_col call MIOS_HLP_GetBitANDMask ; (inverted 1 of 8 code) ... and finally in sm_simple.h: ... extern unsigned char sm_button_value; extern unsigned char sm_col; ... I don't think this is the most efficient way to do thisbut it works for me :)Michaël Quote
DrBunsen Posted July 4, 2006 Report Posted July 4, 2006 Well done mess :D I'm adding a link to here from the Drumstuff page.What project are you building this into? Quote
mess Posted July 4, 2006 Author Report Posted July 4, 2006 ever since I saw the clockbox example I wanted to build a drum seqso it's gonna be a drumseq :Dyou can read some information on my first attempt here:http://www.midibox.org/forum/index.php?topic=6980.msg45082#msg45082the new design is based on some of the suggestions in the "when will come the trseq" thread feature list:32 step 8 track drum seq, each step has trig/acc/roll16 patterns, will be expanded when seq is up and runningpatterns are saved on a banksticksimple UI:lcd: displaying [bpm pat trknr (edited par)]32 step buttons + stepleds, leds are dual color to display trig/accall functions are accessed with a stepkey + shift combinationpattern selection: stepkey + pattern buttontrack select/mute: stepkey + track buttonrotary encoder for modifying parameterssome pics of the seq:picture to show the size (it's reeaally compact ;D)matrix wiring mess: Quote
mess Posted July 5, 2006 Author Report Posted July 5, 2006 I've started a wiki page about the seq:http://www.midibox.org/dokuwiki/doku.php?id=dseq32page is still under construction :)Michaël 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.