Wrong Logic generated for PIC16f877A Microcontroller by LDmicro (by USMAN ALI BUTT(Pakistan))
Hi Jonathan Westhues!
I just made a simple logic in LDmicro. Its when ever Port-C Pin#0 is high. Then portB Pin#7 should accutated..
Push button is attached to port-c pin0 and output is at port-b pin7...
When i run the simulation it is ok.....
But when i download it in pic16f8777a microcontroller. It blinks the output led. I haven't pressed any button etc nor did i do any thing just downloaded the IHEX file in microcontroller, power it and it starts blinking. I cant figure it out whats the problem is...
When i change the cycle time led starts blinking faster etc....
Can you figure it out...
I write the same logic in c++ language, generated IHEX and downloaded it in microcontroller and its working fine....
I attacted both files.....
Wrong Logic generated for PIC16f877A Microcontroller by LDmicro (by USMAN ALI BUTT(Pakistan))
Heres c++ code which is working fine...
(no subject) (by USMAN ALI BUTT(Pakistan))
MGP did you looked at my testing PLC.ld file... Is it ok? I think its ok.. But the IHEX file it generates is not working properly... Heres the IHEX file....
(no subject) (by USMAN ALI BUTT(Pakistan))
One thing more i noticed that LDmicro is treating RA1 pin-3 of pic16f877a as RA0 pin-2 .... I think its a bug.....
But my question is still their.... Why pic16f877a is working by its own blinking etc.... I am not giving any input... I made ladder that if push button is pressed than their should be output(coil energized)... Please help me i have to show it working condition to my teachers.....
Well Boris if i write logic in c++ and made IHEX its working fine... But LD-Micro IHEX is not working fine...
(no subject) (by USMAN ALI BUTT(Pakistan))
Yes why not its working fine when IHEX file is generated by writting C++ code in MPLAB-IDE by microchip......
(no subject) (by MGP)
Most of your problems are caused by your printed circuit board.
-No decoupling capacitors.
-Floating controller inputs, no GND when the opto is not conducting. (see the 2 ways in the attached file)
-+V and GND lines are to small and too long.
It's not the software, but the oscillating hardware.
Make your circuit on a breadboard with 1 input and 1 output, so you can test your software.
(no subject) (by USMAN ALI BUTT(Pakistan))
Thanks MGP
Previously i didn't pay mush attention on PULL down resistors.. Now when i put pull down resistors, circuit is working properly...
Once again thanks.....