Help on PIC Simulator

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Re: Help on PIC Simulator

Postby ober » Tue Aug 16, 2011 10:21 pm

We are using MPLAB IDE + HI-TECH C Compiler (for PIC16) or MPLAB C18 (for PIC18F).

You can refer to the tutorial of SK40C Getting Started
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Help on PIC Simulator

Postby TeoYX » Thu Aug 18, 2011 9:35 pm

Hi,


I downloaded the source code of PR11 and do some simple modifications. However, i downloaded MPLAB but cannot debug the program. How to do the debug to check whether the program is correct or not? I haven't connect the PIC to my PC yet.

Please help. Thanks.


From,
Teo
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: Help on PIC Simulator

Postby hyng » Fri Aug 19, 2011 9:44 am

If you build the code successfully, then you will no need to debug the code. Normally we will download the code into the PIC and see what is the result. If the code got error, double click on the error message and it will lead you to the error instruction and you can debug from there.

Below link content video to show how to create and build a PIC16F project in MPLab IDE.
http://tutorial.cytron.com.my/2011/08/18/how-to-create-a-project-in-mplab-ide/
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Help on PIC Simulator

Postby TeoYX » Fri Aug 19, 2011 9:18 pm

Is that work even i no connect the PIC to my pc?

Since i don't know whether my source code is correct or not, how do i debug to know the error if any?

Thanks for your teaching video, that's really helpful.
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: Help on PIC Simulator

Postby TeoYX » Sat Aug 20, 2011 12:31 am

Can i use Microsoft Visual Studio to debug the PIC C-program?
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: Help on PIC Simulator

Postby hyng » Sat Aug 20, 2011 11:13 am

TeoYX WROTE:Is that work even i no connect the PIC to my pc?

Since i don't know whether my source code is correct or not, how do i debug to know the error if any?

Thanks for your teaching video, that's really helpful.

Yes, you can build your code even there is no PIC connected.
That's depending on your C programming skill, you have to learn. We provide many sample source code in C, you can learn from there. BTW, is your code really failed to build? Please don't be afraid to try your code on your circuit. At least it is my practice to test the code on my circuit. :lol: We always learning from mistake.
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Help on PIC Simulator

Postby TeoYX » Sat Aug 20, 2011 7:13 pm

hyng WROTE:
TeoYX WROTE:Is that work even i no connect the PIC to my pc?

Since i don't know whether my source code is correct or not, how do i debug to know the error if any?

Thanks for your teaching video, that's really helpful.

Yes, you can build your code even there is no PIC connected.
That's depending on your C programming skill, you have to learn. We provide many sample source code in C, you can learn from there. BTW, is your code really failed to build? Please don't be afraid to try your code on your circuit. At least it is my practice to test the code on my circuit. :lol: We always learning from mistake.



Yes, i success just now. There is something wrong in the program. There shows ADGO is unidentified. I am using the PR11 Temperature Control LM35. This AFGO is the second bit in ADCON0. Do you know what is the problem?

Moreover, can i use Microsoft Visual Studio to do the debugging as well?

Please advice if anyone know. Thanks a lot.
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: Help on PIC Simulator

Postby Brian Griffin » Sat Aug 20, 2011 10:42 pm

TeoYX WROTE:
hyng WROTE:
TeoYX WROTE:Is that work even i no connect the PIC to my pc?

Since i don't know whether my source code is correct or not, how do i debug to know the error if any?

Thanks for your teaching video, that's really helpful.

Yes, you can build your code even there is no PIC connected.
That's depending on your C programming skill, you have to learn. We provide many sample source code in C, you can learn from there. BTW, is your code really failed to build? Please don't be afraid to try your code on your circuit. At least it is my practice to test the code on my circuit. :lol: We always learning from mistake.



Yes, i success just now. There is something wrong in the program. There shows ADGO is unidentified. I am using the PR11 Temperature Control LM35. This AFGO is the second bit in ADCON0. Do you know what is the problem?

Moreover, can i use Microsoft Visual Studio to do the debugging as well?

Please advice if anyone know. Thanks a lot.


You cannot use Microsoft Visual Studio to debug. It is a different entity and PIC compilers has nothing got to do with a Visual Studio.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Previous

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 4 guests