CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

12f675 code will compile but it would not run

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
IceMetal



Joined: 20 Nov 2008
Posts: 79
Location: white Plains, NY

View user's profile Send private message Yahoo Messenger

12f675 code will compile but it would not run
PostPosted: Wed Dec 29, 2010 12:44 pm     Reply with quote

I have this simple code that I been trying to run on my pic12f675

Code:
#include <12F675.h>
#fuses INTRC_IO,NOWDT,NOPUT,NOPROTECT,NOMCLR

#use delay(clock=4000000)


void main()
{
   while(1)
   {
         OUTPUT_HIGH(PIN_A0);
         delay_ms(1000);
         output_low(PIN_A0);
         delay_ms(1000);
   }
}


it does compile but when I burn it into the chip it would not run I though it was something wrong with the hardware, but when I put this hex file that I downloaded from online the led starts blinking

http://www.voti.nl/blink/code/b675i-1.hex
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 29, 2010 1:33 pm     Reply with quote

What's your compiler version ?

Are you running this in Proteus or a real board ?

Also, what's the Vdd voltage on your PIC board ?
IceMetal



Joined: 20 Nov 2008
Posts: 79
Location: white Plains, NY

View user's profile Send private message Yahoo Messenger

PostPosted: Wed Dec 29, 2010 4:44 pm     Reply with quote

PCM programmer wrote:
What's your compiler version ?

Are you running this in Proteus or a real board ?

Also, what's the Vdd voltage on your PIC board ?



I'm using version 4.068



this is my circuit I'm using the pickit 2

voltage is 5V


also I'm using this with MPLAB IDE v8.56
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 29, 2010 6:13 pm     Reply with quote

I installed vs. 4.068 and it works in hardware. The LED is blinking.

I don't see an LED on your schematic. My LED circuit looks like this:
Code:

pin      470 ohms      LED       
A0    ---/\/\/\/------->|----
                            |
                            |
                          -----  Ground 
                           ---
                            -

Also, make sure you compile the program for "Release" mode
and not Debug mode.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group