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 CCS Technical Support

16F675 doesn't work

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







16F675 doesn't work
PostPosted: Tue Dec 07, 2004 1:22 pm     Reply with quote

hi!

i wanted to try out a PIC16F675 with internnal resonator but i wasn't successfull.
i set INTRC for internal clock and connected CLKOUT to oscilloscope and MCLR to hi level. i measured the internal clock but the programme doesn't start. it's a simple progamme that clears the whole tris-a-register (all outputs) and switches GP0 (A0) on and off in a but i can't measure a signal at GP0.
doesn anybody know a solution for my problem?
thanks!
mnv



Joined: 04 Aug 2004
Posts: 7

View user's profile Send private message

PostPosted: Tue Dec 07, 2004 1:25 pm     Reply with quote

sorry, i meant the 12F675!!
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Dec 07, 2004 1:37 pm     Reply with quote

Which compiler version are you using?
Post your program.
Guest








PostPosted: Tue Dec 07, 2004 1:59 pm     Reply with quote

i used the 3.150 compiler
this is the source code:

Code:


#include <12f675.h>
#fuses INTRC,NOWDT,NOPROTECT,MCLR,BROWNOUT
#use delay(clock=4000000)

void main(void)
{

    delay_ms(1); //for "security" purpose
    setup_comparator(NC_NC_NC_NC);
    setup_adc(NO_ANALOGS);
    set_tris_a(0b00000000);

    while (1) {
        output_a(0xff);
        delay_ms(100);
        output_a(0x00);
        delay_ms(100);
    }

}



...so the led connected on any GP-pin should blink. right? but it doesn't and i have no idea why Confused
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Tue Dec 07, 2004 2:17 pm     Reply with quote

One thing I see... from datasheet.

• Operating speed:
- DC - 20 MHz oscillator/clock input
- DC - 200 ns instruction cycle

Are you using a 40mhz crystal?
mnv



Joined: 04 Aug 2004
Posts: 7

View user's profile Send private message

PostPosted: Tue Dec 07, 2004 2:20 pm     Reply with quote

no, i use internal crystal (INTRC-fuse).
might the missing crystal-calibration cause such a problem and how can i calibrate the crystal if needed?
thx!!!
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Dec 07, 2004 4:44 pm     Reply with quote

Quote:
...so the led connected on any GP-pin should blink. right?

No, not all pins can be used as general I/O pins:
- GP3 can only be an input, not output.
- GP4 is now configured as clock output (change your fuse #INTRC to #INTRC_IO if you want to use GP4 for general purpose I/O.

Some suggestions:
- Increase the delay so the led will blink only once a second. Now it is blinking 5 times a second which might be difficult to see.
- Add a PUT fuse setting, this will improve startup stability.
- Double check your led is not reverse connected.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Dec 07, 2004 6:29 pm     Reply with quote

I took your program and compiled it with PCM vs. 3.150.
I don't have a 12F675, so I programmed it into a 12F629,
which is a very similar chip. It worked.

I have +5v connected to pins 1 and 4 on the chip,
and Ground connected to pin 8. Verify that you
have those same three connections.

When the program is running, I can see about a 5 Hz
square wave on pins 7, 6, 5, and 2. On pin 3, I see
about a 1 MHz square wave.
Guest








PostPosted: Wed Dec 08, 2004 4:55 am     Reply with quote

thanks for your efforts @PCM programmer!
i assume i did everything possible so i will wait for my 12F629-samples.
as i read in this forum the 12F675 comes with some problems and i'm not the only person who has them.

@ckielstra
it doesn't even work with the PUT fuse. and for my oscilloscope the signals that should be supplied by one of the 5 GP-pins should be displayable. well... it just doesn't work. the programme doesn't start up because even the set_tris-command isn't processed (HI-Z on every available GP-pin).
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