#pragma used+ sfrb TWBR=0; sfrb TWSR=1; sfrb TWAR=2; sfrb TWDR=3; sfrb ADCL=4; sfrb ADCH=5; sfrw ADCW=4; sfrb ADCSRA=6; sfrb ADCSR=6; sfrb ADMUX=7; sfrb ACSR=8; sfrb UBRRL=9; sfrb UCSRB=0xa; sfrb UCSRA=0xb; sfrb UDR=0xc; sfrb SPCR=0xd; sfrb SPSR=0xe; sfrb SPDR=0xf; sfrb PIND=0x10; sfrb DDRD=0x11; sfrb PORTD=0x12; sfrb PINC=0x13; sfrb DDRC=0x14; sfrb PORTC=0x15; sfrb PINB=0x16; sfrb DDRB=0x17; sfrb PORTB=0x18; sfrb PINA=0x19; sfrb DDRA=0x1a; sfrb PORTA=0x1b; sfrb EECR=0x1c; sfrb EEDR=0x1d; sfrb EEARL=0x1e; sfrb EEARH=0x1f; sfrw EEAR=0x1e; sfrb UBRRH=0x20; sfrb UCSRC=0X20; sfrb WDTCR=0x21; sfrb ASSR=0x22; sfrb OCR2=0x23; sfrb TCNT2=0x24; sfrb TCCR2=0x25; sfrb ICR1L=0x26; sfrb ICR1H=0x27; sfrb OCR1BL=0x28; sfrb OCR1BH=0x29; sfrw OCR1B=0x28; sfrb OCR1AL=0x2a; sfrb OCR1AH=0x2b; sfrw OCR1A=0x2a; sfrb TCNT1L=0x2c; sfrb TCNT1H=0x2d; sfrw TCNT1=0x2c; sfrb TCCR1B=0x2e; sfrb TCCR1A=0x2f; sfrb SFIOR=0x30; sfrb OSCCAL=0x31; sfrb TCNT0=0x32; sfrb TCCR0=0x33; sfrb MCUCSR=0x34; sfrb MCUCR=0x35; sfrb TWCR=0x36; sfrb SPMCR=0x37; sfrb TIFR=0x38; sfrb TIMSK=0x39; sfrb GIFR=0x3a; sfrb GICR=0x3b; sfrb OCR0=0X3c; sfrb SPL=0x3d; sfrb SPH=0x3e; sfrb SREG=0x3f; #pragma used- #asm #ifndef __SLEEP_DEFINED__ #define __SLEEP_DEFINED__ .EQU __se_bit=0x80 .EQU __sm_mask=0x70 .EQU __sm_powerdown=0x20 .EQU __sm_powersave=0x30 .EQU __sm_standby=0x60 .EQU __sm_ext_standby=0x70 .EQU __sm_adc_noise_red=0x10 .SET power_ctrl_reg=mcucr #endif #endasm #pragma used+ void delay_us(unsigned int n); void delay_ms(unsigned int n); #pragma used- flash char picture[]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x40,0x80,0x00,0x62,0x44,0x08,0x10,0x00,0x80,0x48,0x84,0x00,0x00,0x60,0x20,0x00,0xC0,0x40,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x10,0x84,0x79,0x04,0x03,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x17,0x10,0x00,0x00,0x00,0x20,0x20,0x40,0x80,0x80,0x01,0x22,0x9C,0x70,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x40,0xC0,0x00,0x60,0x40,0x10,0x40,0x60,0x20,0x80,0x40,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x04,0x04,0x06,0x08,0x10,0x70,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x20,0x00,0x00,0x08,0x01,0x07,0x06,0x04,0x06,0x04,0x07,0x04,0x04,0x00,0x08,0x08,0x10,0x70,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x7A,0x7A,0x00,0x40,0x00,0x02,0x00,0x04,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x40,0x80,0x00,0x60,0x80,0x30,0x60,0x18,0x18,0x20,0x0C,0x14,0x12,0x06,0x0C,0x03,0x07,0x04,0x03,0x03,0x1A,0x01,0x1F,0x7D,0x3C,0x3C,0x3C,0x7D,0x19,0x06,0x02,0x03,0x05,0x04,0x02,0x09,0x0C,0x06,0x12,0x0A,0x24,0x30,0x40,0x60,0x30,0xC0,0xC0,0x20,0xA0,0xC0,0x40,0x10,0x90,0x00,0x08,0x08,0x04,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x10,0x10,0x08,0x0C,0x06,0x03,0x80,0x80,0x80,0x00,0x00,0xC0,0xC0,0x80,0xFF,0x00,0x00,0x07,0x45,0x08,0xC0,0x87,0x00,0x00,0x80,0xFF,0x08,0xE0,0xF0,0xF0,0xE0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x01,0x01,0x01,0x81,0x01,0x3F,0x21,0x21,0x21,0x21,0x7B,0x3F,0x25,0x25,0x25,0x3F,0xBB,0x21,0x21,0x21,0x39,0x25,0x23,0xA3,0x27,0x2F,0x3D,0x39,0x31,0x21,0x23,0x3F,0x27,0x25,0x2D,0x39,0x39,0x3F,0x3F,0x21,0x21,0x3B,0x7F,0x3F,0x25,0x25,0x25,0x2F,0x3B,0x39,0x31,0xE1,0x21,0x21,0x21,0x21,0x3F,0x21,0x01,0xC0,0x00,0xE0,0x20,0x20,0x00,0x00,0x00,0x30,0x30,0x20,0x00,0x88,0x98,0x98,0x10,0x80,0x8C,0x4C,0x48,0x40,0x00,0xC6,0xE6,0x24,0x20,0x00,0x03,0xE3,0xF2,0x10,0x10,0x01,0x01,0x09,0xF8,0xF8,0x00,0x00,0x04,0xFF,0x00,0x00,0x8D,0x88,0x98,0x90,0x3D,0x01,0x00,0xDA,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFC,0xFC,0xF8, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0xFF,0x56,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0xFF,0xFF,0x10,0xAC,0xF4,0x3E,0x25,0x27,0x23,0x22,0x22,0xE2,0x22,0x22,0x22,0x23,0x25,0x26,0x3A,0xE4,0xF8,0x00,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x02,0x00,0x00,0x7F,0x41,0x41,0x00,0x3F,0x3F,0x00,0x00,0x20,0x20,0x3F,0x3F,0x00,0x80,0x80,0x80,0x9F,0x9F,0x90,0x90,0x80,0x80,0x8F,0x8F,0x88,0x08,0x48,0x48,0x40,0xC7,0x47,0xC0,0xC0,0x04,0x0F,0x00,0x10,0x05,0x21,0x22,0x26,0x20,0x30,0x00,0x0F,0x06,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x7F,0x6B,0x40,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x7F,0x7F,0x40,0x54,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x7F,0x40,0x7F,0x7F,0x40,0x40,0x40,0x7F,0x7F,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xF0,0xFF,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x40,0xFF,0xFF,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x3F,0xFF,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x3F,0x2B,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x2F,0x20,0x3F,0x3F,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3F,0x20,0x2F,0x2F,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x3F,0x20,0x20,0x20,0x2F,0x3F,0x2F,0x2F,0x3F,0x3F,0x3F,0x3F,0x3F }; void write_lcd(char columns,char page,char data); void LatchLCD(); void shiftup(); void shiftdown(); unsigned int i,x,y; void main(void) { PORTB.1=0; PORTB.2=0; PORTB.0 =1; for(i=0;i<1024;i++){ if(x>=128){ x=0; y++; } write_lcd(x,y,picture[i]); x++; } shiftup(); shiftdown(); PORTA=0x00; DDRA=0xFF; PORTB=0x00; DDRB=0xFF; PORTC=0x00; DDRC=0x00; PORTD=0x00; DDRD=0x00; TCCR0=0x00; TCNT0=0x00; OCR0=0x00; TCCR1A=0x00; TCCR1B=0x00; TCNT1H=0x00; TCNT1L=0x00; ICR1H=0x00; ICR1L=0x00; OCR1AH=0x00; OCR1AL=0x00; OCR1BH=0x00; OCR1BL=0x00; ASSR=0x00; TCCR2=0x00; TCNT2=0x00; OCR2=0x00; MCUCR=0x00; MCUCSR=0x00; TIMSK=0x00; ACSR=0x80; SFIOR=0x00; while (1) { }; } void LatchLCD() { delay_us(7); PORTB.1=1; delay_us(7); PORTB.1=0; } void shiftup() { char i,j; for(i=0;i<64;i++){ for(j=0;j<2;j++){ PORTB.5=~PORTB.5; PORTB.4=~PORTB.5; PORTB.3 =0; PORTB.2=0; PORTA=0xC0 | i; LatchLCD(); } delay_ms(50); } } void shiftdown() { char i,j; for(i=64;i>0;i--){ for(j=0;j<2;j++){ PORTB.5=~PORTB.5; PORTB.4=~PORTB.5; PORTB.3 =0; PORTB.2=0; PORTA=0xC0 | i; LatchLCD(); } delay_ms(50); } } void write_lcd(char columns,char page,char data) { if(columns >= 64){ PORTB.5=0; PORTB.4=1; }else{ PORTB.5=1; PORTB.4=0; } PORTB.3 =0; PORTB.2=0; PORTA=0xB8 | page; LatchLCD(); PORTB.3 =0; PORTB.2=0; PORTA=0x40 | columns; LatchLCD(); PORTB.3 =1; PORTB.2=0; PORTA=data; LatchLCD(); }