Chương trình trên mình viết theo từng module mà, lcd_lib hoàn toàn không có lỗi gì. Chỉ có lỗi của ngắt thôi. Nhưng thư viện đó có sẵn trong WINAVR mà, cú pháp thì chắc không có gì sai đúng ko?

void EEPROM_write(unsigned int uiAddress, unsigned char ucData) { /* Wait for completion of previous write */ while(EECR & (1<<EEWE)) ; /* Set up address and data registers */ EEAR = uiAddress; EEDR = ucData; /* Write logical one to EEMWE */ EECR |= (1<<EEMWE); /* Start eeprom write by setting EEWE */ EECR |= (1<<EEWE); }
void EEPROM_write(unsigned int uiAddress, unsigned char ucData) { /* Wait for completion of previous write */ while(EECR & (1<<EEWE)) ; /* Set up address and data registers */ EEAR = uiAddress; EEDR = ucData; /* Write logical one to EEMWE */ EECR |= (1<<EEMWE); //EECR |= (1<<EEWE); /* Start eeprom write by setting EEWE */ asm("sbi 0x1C,1"); }
13: EECR |= (1<<EEWE); +00000227: 9AE1 SBI 0x1C,1 Set bit in I/O register
13: EECR |= (1<<EEWE); +00000227: 9AE1 SBI 0x1C,1 Set bit in I/O register
int temp, result,view,hundreds, tens, ones,count; count++; DDRB = 0XFF;
int temp, result,view,hundreds, tens, ones; static int count=0;//việc cho count bằng 0 này chỉ 1 lần sau khi cấp điện cho vđk sau đó nó là static. count++; DDRB = 0XFF;
unsigned char test; void main() { test=0x55; DDRB=0xff; while(1) { test--; PORTB=test; delay(1000); } }
Comment