normad
Member
hey guys im trying to simulate a pic16f877a on the proteus simulator.. the simulation was working just fine but when i kept making my main function longer it just stopped working and i cant figure out why.. if theres no obvious reason ill post the code..
i have a while(1) {} loop in the main function and in it i have three if() {} statements. These if statements are turned on and off by flags controlled by interrupts. as for interrupts im using timer1 timer 2 and portB interrupt on change. All of them work fine. But when i added the third if() {} that doesnt seem to work. The control part of that flag works fine. But when i checked by messing around with the code it seems the while(1) loop has stopped. and it starts again on an interrupt only. isnt a while loop supposed to loop regardless of interrupts? is this a limitation of the simulator? compiler or pics itself? or is my code wrong?
i cant test it on the hardware yet as my hardware isnt ready yet. id like to know if anyone had any related experience.
and if it matters ive turned off my watchdog timer
i have a while(1) {} loop in the main function and in it i have three if() {} statements. These if statements are turned on and off by flags controlled by interrupts. as for interrupts im using timer1 timer 2 and portB interrupt on change. All of them work fine. But when i added the third if() {} that doesnt seem to work. The control part of that flag works fine. But when i checked by messing around with the code it seems the while(1) loop has stopped. and it starts again on an interrupt only. isnt a while loop supposed to loop regardless of interrupts? is this a limitation of the simulator? compiler or pics itself? or is my code wrong?
i cant test it on the hardware yet as my hardware isnt ready yet. id like to know if anyone had any related experience.
and if it matters ive turned off my watchdog timer