Blinking LEDs

Hi all

I 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?  :cry:

Thanks for reply

Best Regards

LX

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

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_Timer

do you have experience with assembler coding?

otherwise it would be easier to do this in C

let me know if you need more hints

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 dont :-\ You can also try blinking LEDs, but you cant change the intervals.

Thanks you all..

I try to prog with MIOS_TIMER  ::slight_smile:

I hope that I’ll be successful.. :wink:

Best regards

LX

Hi

;D !!! success !!! 8)

It’s functional…

I use timer with period about 25ms and filtering every 8th cycle. -> ideal blinking.. :smiley:

I 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.  :slight_smile:

B.R. LX

Great  :smiley:

Im very interested in this Code…is it programmed in C or Assembler ??

do you want to share your programming ?? :slight_smile:

Regards

MTE

me too!

please share!

in assembler… :wink:

I must tune this code, becouse i found 3 mistakes at some special combination of switching clips  :-\

But it’s 1-2 days debugging  :slight_smile:

Than I’ll make video of this..and share code  ;)  (but it is quite secial for my Buttons module) -> only for your help  :slight_smile:

B.R. LX

cant await  ;D

yay!  ;D

best thing that happened today

I’m very interested too  ;D

hope it’s not too complicated for me !

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
  1. 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

registers

LX_BL_Switch - if bit D0 is 0/1=On/Off LED

LX_BL_Enable - if D0 is 0/1=disable/enable blinking

LX_Blinking_Button - into save number of button

I finish today…  :-\

B.R. LX

5.3.2007 - sorry, I must edit this reply today (code was wrong)  :-\