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

PIC10f204 configuration

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



Joined: 02 Aug 2010
Posts: 30

View user's profile Send private message

PIC10f204 configuration
PostPosted: Sun Mar 31, 2013 11:50 pm     Reply with quote

Hello,

I am trying to get a simple code running on a PIC10f204 to flash an LED. This is always my first step to make sure the GPIO pins are functioning properly. I wrote this code and unfortunately the PIC output GP1 pin never worked. Here is the code, any idea what I am missing ? I appreciate your comments. Thanks

Code:

#include <10f204.h>

#use delay (CLOCK=4000000) //(clock=4M)
#fuses NOWDT, NOMCLR, NOPROTECT


#byte CMCON0 = 7
#bit  CMCON0_3=CMCON0.3


void main(void)
{
//Turn off comparator
CMCON0_3=0;

while(1){
   OUTPUT_HIGH(PIN_B1);
   delay_ms(500);
   OUTPUT_LOW(PIN_B1);
   delay_ms(500);
   }
}   
temtronic



Joined: 01 Jul 2010
Posts: 9134
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Apr 01, 2013 3:13 pm     Reply with quote

first observations would be

1) *MCLR tied high ? or disabled ??

2) GP1 is used for programming, is it 'removed' from that when testing?

3) proper bit set to disable the comparator?

4) version of compiler issues ??

5) tested good LED ? Heck I've bought bad 'new' ones before ??


report back....

hth
jay
kbruin79



Joined: 02 Aug 2010
Posts: 30

View user's profile Send private message

PostPosted: Mon Apr 01, 2013 4:29 pm     Reply with quote

Thanks for the reply, see my answers below.

temtronic wrote:
first observations would be

1) *MCLR tied high ? or disabled ??
MCLR set as input. So it's disabled

2) GP1 is used for programming, is it 'removed' from that when testing?
Yes it's removed from the programing circuit when tested
3) proper bit set to disable the comparator?
Yes, 3rd bit in the CMCON0 disables the comparator.
//Turn off comparator
CMCON0_3=0;


4) version of compiler issues ??
It's either 4.16 or 4.19 but I will check when I get home

5) tested good LED ? Heck I've bought bad 'new' ones before ??
I checked that too, LED is working.

report back....

hth
jay
kbruin79



Joined: 02 Aug 2010
Posts: 30

View user's profile Send private message

PostPosted: Tue Apr 02, 2013 10:56 am     Reply with quote

Problem fixed, it was a programer issue. Thanks !
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