Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Same Code Different Output MPLAB and MikroC

Status
Not open for further replies.
I have written an LCD display project for 16x2 LCD. The code is based on third party library. When the code is compiled on MPLAB v8.10 XC8 Compiler the hex gives output on ISIS but not on Hardware where as if same code is compiled in MikroC (replacing __delay_us with Delay_ms and removing XC8 Header and config bits) the project works fine on ISIS and also on hardware.

Controller is PIC18f452
Crystal is 8 MHZ
For sure there are following are obvious.

1. The code is not faulty
2. Programmer is not faulty
3. Hardware is not faulty


The config bits preceived for different hex files by pickit2

bits-xT63Ui6m.1367508005.png


What may be the difference? cant understand that. The attachment contains the Project file of MikroC and MPLAB along with ISIS schematic to do the test. Please help me out
 

Attachments

  • Complete Code + Proteus.zip
    215.9 KB · Views: 346
Last edited:
no problem without you i could not do this.............. Love your response. Another question that why does this happen i mean if it is for in system programming then why it does not allow system to run properly
 
When you select low voltage programming... You can't use that pin for anything else...

ISIS doesn't sim this AND!!! Most compilers, including XC8, expect you to set this value yourself..
 
If your not using the PGM pin if you pulled it low with a 1 k resistor it still should work on real hardware.

Without it pulled low the chip will not start.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top