anishpsla
Member level 2
I am writing a firmware for my project using PIC16F877A and Mikroc. In this firmware, I want to change values stored in EEPROME of PIC. The circuit have 6 buttons for selecting and changing values. The buttons are connected to various pins of PORT D. All of the functions are worked without any problem. When I add EEPROM_Write function on Button 6 pressed, it stops working. After that, the LCD is blank. No response from any of the buttons.
I do lot of experiments with EEPROM_Write. If I add EEPROM_Write in any part of the firmware, it stops working. I am using button library in MikroC. Here is the sample code, I want to work perfectly.
I do lot of experiments with EEPROM_Write. If I add EEPROM_Write in any part of the firmware, it stops working. I am using button library in MikroC. Here is the sample code, I want to work perfectly.
Code:
while(menu==1)
{
if (Button(&PORTD, 4, 150, 0))
{
//Temp
Delay_ms(500);
Eeprom_Write(0x00,new_temp_mem);
Delay_ms(100);
//Fan1 RPM
Eeprom_Write(0x02,new_rpm0_mem); //lower byte
Delay_ms(200);
Eeprom_Write(0x01,new_rpm0_mem>>8); //upper byte
Delay_ms(200);
//Fan2 RPM
Eeprom_Write(0x04,new_rpm1_mem); //lower byte
Delay_ms(200);
Eeprom_Write(0x03,new_rpm1_mem>>8); //upper byte
Delay_ms(200);
}
}