;Warnings! The avrstudio not automatically loaded the eeprom content ;Use Debug->up/download menu! ;*************************************************************** ;*** 4 bit LCD interface for the AVR Stamp, Atmega 128 ;*** Version 2.0 ;*** Date 2004.08.27 ;*** Author : Pipi ;*** E-mail avr@puzsar.hu ;*** Web page : http://www.puzsar.hu ;*************************************************************** ;*** It works on 20x4 LCD that is based on the Hitachi ;*** HD44780 lcd controler and can be easily modified to work ;*** with other LCD's ;*** Busy flag read not supported, use delay ;*********************************************************************************** ;*** LCD Subrutines and Terminal control commands: ;*** LCD_Home (CTLR-A ASCII 1) Move cursor at beginning of first line ;*** LCD_On (CTLR-B ASCII 2) Turn display on ;*** LCD_Off (CTLR-C ASCII 3) Turn display off ;*** LCD_CursorOFF (CTRL-D ASCII 4) No cursor will be displayed ;*** LCD_CursorOn (CTRL-E ASCII 5) Underline Cursor on ;*** LCD_BlinkON (CTRL-F ASCII 6) Blink Block Cursor ;*** LCD_CLS (CTRL-L ASCII 12) Clear LCD, move cursor at beginning of first line ;*** LCD_BlinkOFF (CTRL-N ASCII 14) The chararcter at the cursor position will not blink ;*** LCD_ShiftDisplayR (CTRL-O ASCII 15) Shift ALL LINES 1 char to the Right ;*** LCD_ShiftDisplayL (CTRL-P ASCII 16) Shift ALL LINES 1 char to the Left ;*** LCD_ShiftCursorR (CTRL-Q ASCII 17) Shift cursor one position to the right ;*** LCD_ShiftCursorL (CTRL-R ASCII 18) Shift cursor one position to the left ;*** Delay100ms (CTRL-S ASCII 19) ;*** Delay1s (CTRL-S ASCII 20) ;*** other LCD Terminal control commands: ;*** Carr. Return (CTRL-M ASCII 13) ;*** BackSpace (CTRL-H ASCII 8) ;*** LineFeed (CTRL-J ASCII 10) ;*** Vertical Tab (CTRL-K ASCII 11) ;Other Subrutines ;********************************************************************* ;**** ;**** LCD_Write_Chr: write ASCII char to LCD and execute control char ;**** ;********************************************************************* ;**** ;**** LCD_Data: write char to Lcd, check/modify cursor position if line end ;**** ;*************************************************************************** ;**** ;**** LCD_Command: write CmdReg to LCD control register ;**** ;********************************************************************** ;**** ;**** LCD_GotoXY: set cursor position LCD_X, LCD_Y ;**** ;************************************************************* ;**** ;**** LCD_Eeprom_str: write string to LCD from Eeprom (EEAR pointer) ;**** ;********************************************************************* ;**** ;**** EERead_seq: reads the EEPROM into the register variable "EE_dat". ;**** increments the address, stored in EEARL ;**** ;*************************************************************************** ;**** ;**** LCD_Flash_str: write string to LCD from Flash (Z register pointer) ;**** ;************************************************************************ ;**** ;**** LCD_Delay_Flash_str: write string to LCD from Flash +0.1sec delay ;**** (Z register pointer) ;**** ;************************************************************************ ;**** ;**** UART_Putchar: Send DataReg using the UART port ;**** ;**************************************************** ;**** ;**** UART_Getchar: Get a char from the UART ;**** No Carry if ready and DataReg contains the char ;**** ;**************************************************** ;**** ;**** Delay40us: Delay 40 mikrosec ;**** ;********************************************************************* ;**** ;**** Delay100us: Delay 100 mikrosec ;**** ;********************************************************************* ;**** ;**** Delay100ms: Delay 100 milisec ;**** ;********************************************************************* ;**** ;**** Delay4ms: Delay 4 milisec ;**** ;********************************************************************* ;**** ;**** Delay1s: Delay 1 sec ;**** ;********************************************************************* ;*** Connections ;*** LCD CONTROLS ;*** PortA.0 Lcd RS ;*** PortA.1 Lcd EN ; Lcd R/W directly low, only write ; Busy flag read sot supported ; Lcd D0..D3 not connected ;*** PortA.4 Lcd D4 ;*** PortA.5 Lcd D5 ;*** PortA.6 Lcd D6 ;*** PortA.7 Lcd D7 .equ lcdrs =0 ;LCD RS pin connected to PortA0 .equ lcden =1 ;LCD E pin connected to PortA1 ;*** PORTC.0 LED_0 ;*** PORTC.1 LED_1 ;*** PORTC.2 LED_2 ;*** PORTC.3 LED_3 ;*** PORTC.4 LED_4 ;*** PORTC.5 LED_5 ;*** PORTC.6 LED_6 ;*** PORTC.7 LED_7 ;*** SERIAL CONNECTIONS ;*** PORTE.0 TX RS232 Serial transmit (TX) ;*** PORTE.1 RX RS232 Serial receive (RX) ;*** PORTE.2 USB- ;*** PORTE.3 USB+ ;*** PORTE.4 INT0 ;*** PORTE.5 BT0 ;*** PORTE.6 BT1 ;*** PORTE.7 BT2 ;*** PORTG.0 SW_0 ;*** PORTG.1 SW_1 ;*** PORTG.2 ;*** PORTG.3 SW_3 ;*** PORTG.4 SW_2 ;*** A number of routines and macros are implemented which ;*** can be easily re-used ;*** LCD_Init - Initilize the LCD and set cursor at the beggining of first line ;*** Uart_Init - Initilize the serial port ;*** LCD_EPulse - Togle the E line High and then Low .nolist ;Suppress listing of include file .include "m128def.inc" ;Set atmega128 data for the compiler .list ;***** register variables ;.def ctmp2 =R16 .def idovalsec =R16 .def tmp1 =r17 .def tmp2 =R18 .def DataReg =r20 .def LCD_X =r21 .def LCD_Y =r22 .def CmdReg =R23 .def wreg =R24 .def EE_dat =r25 ;result data byte .def Line_Wrap=r19 .def temp=R26 ;0 = No line wrap 1= Wrap to next line when reach last xpos ;.def kiirtmp3=R27 ;.def ctmp3=R28 .def idovalmin =R27 .def idovalhour =R28 ;.def count =R29 .def mode =r30 .def idotmp =r31 .equ tconst = 100 .equ LineLength=20 .equ NoOfLines=4 .equ FirstLine_Add =0b10000000 ;Base address of first line for 2x16 lcd .equ SecondLine_Add=0b11000000 ;+40 Base address of second line .equ ThirdLine_Add =0b10010100 ;+14 Base address of 3.line .equ FourthLine_Add=0b11010100 ;+54 Base address of 4.line ;*** Baud rates ;*** All baud rates are for a 4Mhz crystal ;*** Check 2313's data sheet (table 14) to change to other crystals ;clk=11059200 ;BAUDconst=(clk/16/BAUD)-1 .equ BAUDconst=71 ;9600 .cseg ; Interrupt vectors .org 0 rjmp reset ;Reset Vector reti ; INT0 Handler on $0002, dummy nop reti ; INT1 Handler, if INTn used, 'reti' and 'nop' ; will be replaced by 'jmp INTn_Handler_Address' nop reti ; INT2 Handler nop reti ; INT3 Handler nop reti ; INT4 Handler nop jmp ITgomb ; INT5 Handler ;nop reti ; INT6 Handler nop reti ; INT7 Handler nop reti ; Timer2 Compare Match Handler nop reti ; Timer2 Overflow Handler nop reti ; Timer1 Capture Event Handler nop reti ; Timer1 Compare Match A Handler nop reti ; Timer1 Compare Match B Handler nop reti ; Timer1 Overflow Handler nop jmp t0it ; Timer0 Compare Match Handler ;nop reti ; Timer0 Overflow Handler nop reti ; SPI Transfer Complete Handler nop reti ; USART0 RX Complete Handler nop reti ; USART0 Data Register Empty Hanlder nop reti ; USART0 TX Complete Handler nop reti ; ADC Conversion Complete Handler nop reti ; EEPROM Ready Hanlder nop reti ; Analog Comparator Handler nop reti ; Timer1 Compare Match C Handler nop reti ; Timer3 Capture Event Handler nop reti ; Timer3 Compare Match A Handler nop reti ; Timer3 Compare Match B Handler nop reti ; Timer3 Compare Match C Handler nop reti ; Timer3 Overflow Handler nop reti ; USART1 RX Complete Handler nop reti ; USART1 Data Register Empty Hanlder nop reti ; USART1 TX Complete Handler nop reti ; Two-wire Serial Interface Handler nop reti ; Store Program Memory Ready Handler nop reset: ;init stack ldi temp,RAMEND ;Init Stack Pointer out SPL,temp ldi temp,RAMEND>>8 ;Init Stack Pointer out SPH,temp ;init ports ldi wreg,0x00 ;PORTA Low out PORTA,wreg ldi wreg,0xFF ;Make port A pin all outputs out DDRA,wreg ldi wreg,0xff ;PORTB Hi out PORTB,wreg ldi wreg,0x80 ;Make port B7 out, others input out DDRB,wreg ; ldi wreg,0x00 ;PORTC Low ; out PORTC,wreg ; ldi wreg,0xFF ;Make port C pin all outputs ; out DDRC,wreg ldi temp,0b11111111 ; portbitek kimenetek out DDRC,temp ldi wreg,0xff ;PORTE Hi out PORTE,wreg ldi wreg,0x01 ;Make port E0 out, others input out DDRE,wreg ldi wreg,0xff ;PORTG Hi sts PORTG,wreg ldi wreg,0x00 ;Make port G pin all input sts DDRG,wreg ;init others ldi Line_Wrap,1 ;0 = No line wrap 1= Wrap to next line when reach last xpos call Lcd_Init ;Init the LCD call LCD_Cls ldi temp, 0b11100011 out ADMUX, temp ldi temp, 0b11100111 out ADCSR, temp ;ldi ctmp2, 0x30 ;ldi kiirtmp3, 0x41 ;ldi ctmp3, 0x7 ldi mode, 0x01 ldi idovalhour,15 ldi idovalmin,16 ldi idovalsec,17 ldi idotmp,0 ;***** Timer 0 inicializálása ***** ldi temp,0b00001111 ; 0....... ; FOC=0 ; .0..1... ; WGM=10 (CTC mod) ; ..00.... ; COM=00 (kimenet tiltva) ; .....111 ; CS0=111 (CLK/1024) out TCCR0,temp ; Timer 0 TCCR0 regiszter ldi temp,108 ; 11059200Hz/1024 = 108*100 out OCR0,temp ; Timer 0 OCR0 regiszter ldi temp,0b00000010 ; 000000.. ; Timer2,1 IT tiltva ; ......1. ; OCIE0=1 ; .......0 ; TOIE0=0 out TIMSK,temp ; Timer IT Mask regiszter Main_loop: jmp Main_loop ;******************************************************** ;**** ;**** write ASCII char to LCD and execute control char ;**** ;******************************************************** LCD_Write_Chr: cpi DataReg,0x1f brcs CTRLchr ;char is control char jmp WriteLCD ;char is ASCII CTRLchr: cpi DataReg,1 ;Check for a Cursor Home (CTLR-A ASCII 1) brne Check_LCD_On Call LCD_Home ret Check_LCD_On: cpi DataReg,2 ;Check for a LCD_On (CTLR-B ASCII 2) brne Check_LCD_Off Call LCD_On ret Check_LCD_Off: cpi DataReg,3 ;Check for a LCD_Off (CTLR-C ASCII 3) brne Check_HideCursor Call LCD_Off ;Call the macro ret Check_HideCursor: cpi DataReg,4 ;Check for Hide Cursor (CTRL-D ASCII 4) brne Check_UnderlineCursor call LCD_CursorOff ret Check_UnderLineCursor: cpi DataReg,5 ;Check for Underline Cursor (CTRL-E ASCII 5) brne Check_BlinkingBlockCursor call LCD_CursorOn ;Turn cursor ON ret Check_BlinkingBlockCursor: cpi DataReg,6 ;Check for Blinking Block Cursor (CTRL-F ASCII 6) brne Check_Bell call LCD_BlinkOn ;Make the cursor blink ret Check_Bell: ; cpi DataReg,7 ;Check for a Bell (CTRL-G ASCII 7) ; brne Check_BackSpace ; ret ;Do nothing as we do not have an piezo buzzer Check_BackSpace: cpi DataReg,8 ;Check for BackSpace (CTRL-H ASCII 8) brne Check_VerticalTab cpi LCD_X,0 brne Dec_X ldi Datareg,0x20 rcall LCD_Data dec LCD_X rcall LCD_GotoXY ret Dec_X: dec Lcd_X rcall LCD_GotoXY ldi DataReg,0x20 rcall LCD_Data dec Lcd_X rcall LCD_GotoXY ret Check_VerticalTab: ;Check for Vertical Tab Up (CTRL-K ASCII 11) cpi DataReg,0x0b brne Check_ClearScreen cpi LCD_Y,0 brne Cont_VerticalTab ret Cont_VerticalTab: dec LCD_Y call LCD_GotoXY ret Check_ClearScreen: ;Check for Clear Screen (CTRL-L ASCII 12) cpi DataReg,0x0c brne Check_LF call LCD_Cls ret Check_LF: ;Check for LF (CTRL-J ASCII 13) cpi DataReg,0x0a brne Check_CarriageReturn jmp LF Check_CarriageReturn: ;Check for CR (CTRL-M ASCII 13) cpi DataReg,0x0d brne Check_BlinkOff cpi LCD_Y,NoOflines-1 brne CarriageReturn_Cont ldi LCD_Y,0xff CarriageReturn_Cont: ldi LCD_X,0 LF: inc LCD_Y rcall LCD_GOTOXY ret Check_BlinkOff: ;LCD_BlinkOff (CTRL-N ASCII 14) cpi DataReg,0x0e brne Check_LCD_ShiftDisplayR call LCD_BlinkOff ret Check_LCD_ShiftDisplayR: cpi DataReg,0x0f ;LCD_ShiftDisplayR (CTRL-O ASCII 15) brne Check_LCD_ShiftDisplayL call LCD_ShiftDisplayR ret Check_LCD_ShiftDisplayL: cpi DataReg,0x10 ;LCD_ShiftDisplayL (CTRL-P ASCII 16) brne Check_LCD_ShiftCursorR call LCD_ShiftDisplayL ret Check_LCD_ShiftCursorR: ;LCD_ShiftCursorR (CTRL-Q ASCII 17) cpi DataReg,0x11 brne Check_LCD_ShiftCursorL call LCD_ShiftCursorR ret Check_LCD_ShiftCursorL: ;LCD_ShiftCursorL (CTRL-R ASCII 18) cpi DataReg,0x12 brne Check_delay call LCD_ShiftCursorL ret Check_delay: ;delay 100msec (CTRL-S ASCII 19) cpi DataReg,0x13 brne Check_delay1 call delay100ms ret Check_delay1: ;delay 1sec (CTRL-S ASCII 20) cpi DataReg,0x14 brne WriteLCD call delay1s ret WriteLCD: rcall LCD_Data Noexit: ret ;********************************************************************* ;**** ;**** write char to Lcd, check/modify cursor position if line end ;**** ;********************************************************************* LCD_Data: mov wreg,DataReg andi wreg,0x0F0 out PORTA,wreg sbi PortA,lcdrs rcall LCD_EPULSE mov wreg,DataReg swap wreg andi wreg,0x0F0 out PORTA,wreg sbi PortA,lcdrs ; rcall LCD_EPULSE rcall Delay40us inc LCD_X cpi LCD_X,LineLength ;Check if we are at the last Xpos brne Lcd_Write_Exit ;no change LCD_Y cpi Line_Wrap,0 ;Check if Line wrap is on or off breq Lcd_Write_Exit ;no change LCD_Y,No line wrap ldi LCD_X,0 ;Point at the first row X cpi LCD_Y,NoOfLines-1 ;check if we are at the last line of the lcd brne Lcd_Write_NextLine ;If we are not move to the next line ldi LCD_Y,0 rcall LCD_Gotoxy rjmp Lcd_Write_Exit Lcd_Write_NextLine: inc Lcd_Y rcall LCD_Gotoxy Lcd_Write_Exit: ret ;******************** ;**** ;**** Lcd Init ;**** ;******************** Lcd_Init: rcall Delay1s ; Wait approx 1 sec ;first 3*8bit mode and 1*4bit mode, then real programming cbi PortA,lcdrs ;Clear RS ldi Wreg,0x30 ;8bit mode out PORTA,Wreg rcall LCD_EPulse rcall Delay4ms ; ;Wait 4ms ldi Wreg,0x30 ;8bit mode out PORTA,Wreg rcall LCD_EPulse rcall Delay4ms ; ;Wait 4ms ldi Wreg,0x30 ;8bit mode out PORTA,Wreg rcall LCD_EPulse rcall Delay4ms ; ;Wait 4ms ldi Wreg,0x20 ;4bit mode out PORTA,Wreg rcall LCD_EPulse rcall Delay4ms ; ;Wait 4ms ldi CmdReg,0x28 ;4bit mode real rcall LCD_Command rcall Delay4ms ; ;Wait 4ms ldi CmdReg,0x4 ;entry mode set rcall LCD_Command ; rcall Delay4ms ; ;Wait 4ms ldi CmdReg,0xe ;display on rcall LCD_Command ; rcall Delay4ms ; ;Wait 4ms ldi CmdReg,0x1 ;Clear Display rcall LCD_Command rcall Delay4ms ; ;Wait 4ms ldi LCD_X,0 ;Init the positioning values ldi LCD_Y,0 ret ;******************************************** ;**** ;**** write CmdReg to LCD control register ;**** ;******************************************** LCD_Command: cbi PortA,lcdrs mov wreg,CmdReg andi wreg,0xF0 out PortA,wreg ;out high nibble rcall LCD_EPULSE swap CmdReg andi CmdReg,0xF0 out PortA,CmdReg ;out low nibble rcall LCD_EPULSE rcall Delay40us ret ;************************************************** ;**** ;**** LCD_GotoXY set cursor position LCD_X, LCD_Y ;**** ;************************************************** LCD_GotoXY: ldi CmdReg,FirstLine_Add cpi LCD_Y,0 ;Check to see which line breq Calc_X ldi CmdReg,SecondLine_Add cpi LCD_Y,1 ;Check to see which line breq Calc_X ldi CmdReg,ThirdLine_Add cpi LCD_Y,2 ;Check to see which line breq Calc_X ldi CmdReg,FourthLine_Add cpi LCD_Y,3 ;Check to see which line breq Calc_X Calc_X: add CmdReg,LCD_X rcall LCD_Command ;Set DDRam Add rcall Delay40us ret ;*************************** ;**** ;**** Lcd enable pin pulse ;**** ;*************************** LCD_EPulse: sbi PortA,lcden ;E high nop nop nop nop cbi PortA,lcden ;E Low ret ;******************************** ;**** ;**** Lcd control subrutines ;**** ;******************************** LCD_Cls: ldi CmdReg,0b00000001 rcall LCD_Command rcall delay4ms ldi LCD_X,0 ldi LCD_Y,0 ret LCD_Home: ldi CmdReg,0b00000010 rcall LCD_Command rcall delay4ms ldi LCD_X,0 ldi LCD_Y,0 ret LCD_On: ldi CmdReg,0b00001100 rcall LCD_Command ; rcall delay40us ret LCD_Off: ldi CmdReg,0b00001000 rcall LCD_Command ; rcall delay40us ret LCD_CursorOn: ldi CmdReg,0b00001110 rcall LCD_Command ; rcall delay40us ret LCD_CursorOff: ldi CmdReg,0b00001100 rcall LCD_Command ; rcall delay40us ret LCD_BlinkOn: ldi CmdReg,0b00001111 rcall LCD_Command ; rcall delay40us ret LCD_BlinkOff: ldi CmdReg,0b00001110 rcall LCD_Command ; rcall delay40us ret LCD_ShiftCursorL: ldi CmdReg,0b00010000 rcall LCD_Command ; rcall delay40us ret LCD_ShiftCursorR: ldi CmdReg,0b00010100 rcall LCD_Command ; rcall delay40us ret LCD_ShiftDisplayL: ldi CmdReg,0b00011000 rcall LCD_Command ; rcall delay40us ret LCD_ShiftDisplayR: ldi CmdReg,0b00011100 rcall LCD_Command ; rcall delay40us ret ;************************** ;**** ;**** Delay 40 mikrosec ;**** ;************************** Delay40us: ldi wreg,0x8e Loopx: dec wreg brne loopx ret ;************************** ;**** ;**** Delay 100 mikrosec ;**** ;************************** Delay100us: ldi wreg,0xd8 Loop: nop nop dec wreg brne loop ret ;************************** ;**** ;**** Delay 4 milisec ;**** ;************************** Delay4ms: ldi tmp1,0x39 ;OK Loop1: ldi wreg,0x00 Loop2: dec wreg brne loop2 dec tmp1 brne loop1 ret ;************************** ;**** ;**** Delay 1 sec ;**** ;************************** Delay1s: ldi tmp2,250 ; Delay for about 1 sec for the LCD to start Longdelay_Loop: rcall delay4ms dec tmp2 brne LongDelay_Loop ret ;************************** ;**** ;**** Delay 100msec ;**** ;************************** Delay100ms: ldi tmp2,25 ; Delay for about 1 sec for the LCD to start rjmp Longdelay_Loop ;************************** ;**** ;**** Delay 300msec ;**** ;************************** Delay300ms: ldi tmp2,75 ; Delay for about 1 sec for the LCD to start rjmp Longdelay_Loop www_text: .db "http://www.mscbp.hu",0x0d .db "http://www.pyxys.hu",0x0d .db "http://www.puzsar.hu",20,19 .db 0xc,"Wait character from RS232" .db " 9600,n,8,2",0,0 demo_text: .db "This application use" .db "buttons and switches",20,0xc .db "Lcd str. write from " .db "Flash and Eeprom. " .db "Lcd controls from " .db " RS232 terminal ",20,0x0c,0,0 ;********************************************************************* ;**** ;**** EEPROM Data segment ;**** ;********************************************************************* .eseg EmptyPos: .db 00 ;leave eeprom location 00 empty due to bug ;in AVR that randomly erases the contens InitString1: .db "AVR-Experiment Board",19,00 ;What the LCD will display on power up InitString2: .db " 2004/09 V2.0 BME",19,0 .dseg count: .byte tconst ctmp2: .byte 0x30 ctmp3: .byte 0x07 .cseg t0it: push temp ; segédregiszter mentése in temp,SREG ; státusz mentése push temp lds temp,count ; Timer számláló dec temp ; csökkentése sts count,temp ; és tárolása brne t0ite ; ugrás, ha nem járt le ldi temp,tconst ; számláló visszaállítása sts count,temp ldi LCD_X,1 ldi LCD_Y,2 call LCD_GotoXY cpi mode,0x01 breq Uzemmod1Kiir brne Uzemmod2Kiir timerITkeres: call PontosIdotLeptet t0ite: pop temp ; regiszterek visszaállítása out SREG,temp pop temp dummy: reti Uzemmod1Kiir: in temp, ADCH lsr temp lsr temp lsr temp lsr temp andi temp, 0xF cpi temp,0x0A brcs Xjmp brcc Yjmp XYdone: out PORTC, temp mov DataReg, temp call LCD_Data ldi mode,0x00 jmp timerITkeres Xjmp: lds idotmp, ctmp2 add temp, idotmp jmp XYdone Yjmp: lds idotmp,ctmp3 add temp,idotmp jmp XYdone Uzemmod2Kiir: mov idotmp,idovalhour ldi temp,0x30 add idotmp,temp mov DataReg, idotmp call LCD_Data ldi temp, 0x3A mov DataReg, temp call LCD_Data mov idotmp,idovalmin ldi temp,0x30 add idotmp,temp mov DataReg, idotmp call LCD_Data ldi temp, 0x3A mov DataReg, temp call LCD_Data mov idotmp,idovalsec ldi temp,0x30 add idotmp,temp mov DataReg, idotmp call LCD_Data ldi mode,0x01 jmp timerITkeres PontosIdotLeptet: ldi temp,0x01 add idovalsec,temp cpi idovalsec,0x3C breq IdoSecNull IdoSecTestOver: cpi idovalmin,0x3C breq IdoMinNull IdoMinTestOver: cpi idovalhour,0x18 breq IdoHourNull IdoHourTestOver: ret IdoSecNull: ldi temp,0x01 add idovalmin,temp ldi idovalsec,0x00 jmp IdoSecTestOver IdoMinNull: ldi temp,0x01 add idovalhour,temp ldi idovalmin,0x00 jmp IdoMinTestOver IdoHourNull: ldi idovalhour,0x00 jmp IdoHourTestOver ITgomb: call Delay300ms call EjfelBeallit reti EjfelBeallit: ldi idovalsec,0x00 ldi idovalmin,0x00 ldi idovalhour,0x00 ret