LX Posted February 3, 2007 Report Share Posted February 3, 2007 Hi allI have a question about blinkig LEDs with some interval.I can't find where is place in main.asm for make it this.I thing that mabye is in USER_Timer but I dont know how to do it.Have you any ideas? :'(Thanks for replyBest RegardsLX Quote Link to comment Share on other sites More sharing options...
dj3nk Posted February 4, 2007 Report Share Posted February 4, 2007 Hi,ask MTE. He had to implement some blinking led in his box too. But I dont know if he found a way to do, cause the only command which can be used is MIOS_Delay (sais MTE... don't know if theres another cmd) what delays all operation and not just one dout.Does it have to be softwareside blinking ? If not, you can build a blinking led with a little timer ic. nothing big. Search google.greetz Quote Link to comment Share on other sites More sharing options...
mess Posted February 5, 2007 Report Share Posted February 5, 2007 Hi if you want the timer to do this*first step is to initialise the timer, call MIOS_TIMER_Init(see http://www.ucapps.de/mios_fun.html for more info on how to use this function)*next put your blink code in USER_Timerdo you have experience with assembler coding?otherwise it would be easier to do this in Clet me know if you need more hints Quote Link to comment Share on other sites More sharing options...
Sasha Posted February 5, 2007 Report Share Posted February 5, 2007 I wanted the same thing for my LEDs once, and I had idea of doing this hard way - 555 or something. It is definitly much better to do it using software if you know how, but I don`t :-\ You can also try blinking LEDs, but you can`t change the intervals. Quote Link to comment Share on other sites More sharing options...
LX Posted February 5, 2007 Author Report Share Posted February 5, 2007 Thanks you all..I try to prog with MIOS_TIMER ::)I hope that I'll be successful.. ;)Best regardsLX Quote Link to comment Share on other sites More sharing options...
LX Posted February 15, 2007 Author Report Share Posted February 15, 2007 Hi ;D !!! success !!! 8)It's functional...I use timer with period about 25ms and filtering every 8th cycle. -> ideal blinking.. :DI have finished flashing clips in Ableton Live and it function like the program.I use incoming 4 mesages 7E, 7F, 01, 00 from clip. When I switching clips on PC, midibox LEDs are same like Live. :)B.R. LX Quote Link to comment Share on other sites More sharing options...
MTE Posted February 15, 2007 Report Share Posted February 15, 2007 Great :DIm very interested in this Code....is it programmed in C or Assembler ??do you want to share your programming ?? :)RegardsMTE Quote Link to comment Share on other sites More sharing options...
DavidBanner Posted February 15, 2007 Report Share Posted February 15, 2007 me too!please share! Quote Link to comment Share on other sites More sharing options...
LX Posted February 15, 2007 Author Report Share Posted February 15, 2007 in assembler... ;) I must tune this code, becouse i found 3 mistakes at some special combination of switching clips :-\But it's 1-2 days debugging :)Than I'll make video of this..and share code ;) (but it is quite secial for my Buttons module) -> only for your help :)B.R. LX Quote Link to comment Share on other sites More sharing options...
MTE Posted February 15, 2007 Report Share Posted February 15, 2007 cant await ;D Quote Link to comment Share on other sites More sharing options...
DavidBanner Posted February 15, 2007 Report Share Posted February 15, 2007 yay! ;Dbest thing that happened today Quote Link to comment Share on other sites More sharing options...
bill Posted February 16, 2007 Report Share Posted February 16, 2007 I'm very interested too ;Dhope it's not too complicated for me ! Quote Link to comment Share on other sites More sharing options...
LX Posted March 4, 2007 Author Report Share Posted March 4, 2007 mission complete!!!my code is quite complicated ???I put there steps for easy blinking...1) timer initialization - I place this to USER_Init (but,you can start or finish timer any time) movlw 31250 & 0xff movwf MIOS_PARAMETER1 movlw 31250 >> 8 movwf MIOS_PARAMETER2 movlw 0x03 call MIOS_TIMER_Init timer jump to USER_Timer every 25ms from now 2) You must write this definition on the top of main.asm (determine count of skips then blinking routine will be perform) #define LX_CLIPS_BLINKING_SPEED 8 ; 6=quickly 8=mediumly 10=slowly 3) USER_Timer ----------- USER_Timer ; This is for erase speed interval... movf LX_BL_Clock, W sublw LX_CLIPS_BLINKING_SPEED skpnz clrf LX_BL_Clock ; if LX_BL_Clock = 0 go to LX_PrePlay_BL routine... movlw 0x01 subwf LX_BL_Clock, W skpc rgoto LX_PrePlay_BL rgoto LX_Timer_End LX_PrePlay_BL IFCLR LX_BL_Enable, 0, rgoto LX_Timer_End IFSET LX_BL_Switch, 0, rgoto LX_LED_PrePlay_On LX_LED_PrePlay_Off ; >> ------------------ LED Off ------------------ movf LX_Blinking_Button, W call MIOS_DOUT_PinSet0 bsf LX_BL_Switch, 0 rgoto LX_Timer_End ; << ------------------ LED Off ------------------ LX_LED_PrePlay_On ; >> ------------------ LED On ------------------ movf LX_Blinking_Button, W call MIOS_DOUT_PinSet1 bcf LX_BL_Switch, 0 ; << ------------------ LED On ------------------ LX_Timer_End incf LX_BL_Clock, F return registersLX_BL_Switch - if bit D0 is 0/1=On/Off LEDLX_BL_Enable - if D0 is 0/1=disable/enable blinkingLX_Blinking_Button - into save number of buttonI finish today... :-\B.R. LX5.3.2007 - sorry, I must edit this reply today (code was wrong) :-\ 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.