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.

Program done but pic does not execute it !!

Status
Not open for further replies.
Yuo say "code is good".

The fact that the compiler does compile it means that your wrote it the right way. It does not say that is hardware-wise correct.

You were asked if you could single-step it.

Simulation is in order to see if you are doing what is actually needed to get what you expect.
how do i single step ?
 
I converted your program to HiTech C and it works on the ISIS..


I also attached the isis sim and the hex file. You may try my hex file and see if it works on your ISIS circuit.

Allen
Thanks for the program , but why it does not work with my original one , thats so bizzare .
 
Thanks for the program , but why it does not work with my original one , thats so bizzare .

Well, did you compare your original one with my converted C? And the changes I made on the ISIS circuit?

I inserted the "ADCON1 = 6" in my program which was missing in your program, without which my ISIS refuse to work. I also added resistors to MCLR and RA0 , as I have mentioned earlier, in order to make the simulator work. These addons are not optional.:D

You could also do single stepping as Ian has told you to and see if your program does work as you expected.

Allen
 
Well, did you compare your original one with my converted C? And the changes I made on the ISIS circuit?

I inserted the "ADCON1 = 6" in my program which was missing in your program, without which my ISIS refuse to work. I also added resistors to MCLR and RA0 , as I have mentioned earlier, in order to make the simulator work. These addons are not optional.:D

You could also do single stepping as Ian has told you to and see if your program does work as you expected.

Allen
how do i single step ??
and what is the meaning of ADCON1=6 ?
 
Single stepping through the code in Isis lets you see the code line by line... On the bottom left there are the "Run", "Pause" and "stop" simulator controls....Once you "Pause" the simulation, you can open the code window and step through your code to see where mistakes are...
 
how do i single step ?

As Ian says, by simulating.

Since you never did it before, write a very simple program and learn how to simulate it, by single-stepping, that is, going step by step through it, to see how the registers change as per the actual code.

Once you understand what simulation is and what you are doing (that is, where to look after each step), do the same with the code that you expect to work.

Additional suggestion: whatever you do, always test one additional routine at a time.

The first time I heard the expression "divide and conquer" I believed that they were just words. Wrong I was! If something fails, it is, most probably, in the last section of code that you added. Easy to identify and correct. That suggestion should be carved in stone at the main square.
 
Single stepping through the code in Isis lets you see the code line by line... On the bottom left there are the "Run", "Pause" and "stop" simulator controls....Once you "Pause" the simulation, you can open the code window and step through your code to see where mistakes are...
I will see that
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top