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

Start up problem

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



Joined: 03 Oct 2006
Posts: 13

View user's profile Send private message

Start up problem
PostPosted: Tue Oct 03, 2006 7:09 am     Reply with quote

I have a bunch of 16F84s and 16F84As and am trying to use them up. I've run into a problem in that I can't get them to work. It seems that they don't oscillate. I have used numerous ceramic resonators and crystals with no luck.

I was able to program them using version PCM 3.059. Now that I have PCW v3.190 they won't work. Is there something haywire with PCW v3.190?

I program 12C508As and 16F877As with it with no trouble. Do I have to load my old PCM to get this to work? If I do, will it interfere with my new PCW version?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 03, 2006 1:03 pm     Reply with quote

I don't have PCW, but I installed the command line PCM compiler vs.
3.190 and compiled the following program. I programmed it into a
16F84A on a PicDem2-Plus board and it works OK. It blinks the LED
connected to Pin B0. I think your PCW vs. 3.190 should work.
Code:

#include <16F84A.h>
#fuses XT, NOWDT, NOPROTECT, PUT   
#use delay(clock=4000000)

//=======================================
void main(void)
{

while(1)
  {
   output_high(PIN_B0);
   delay_ms(500);
   output_low(PIN_B0);
   delay_ms(500);
  }

}


PCW, I believe, is installed in the same directory as the command line
compilers, which is c:\Program Files\Picc. If you installed PCW vs.
3.190 and the PCM command line compiler vs. 3.059 in the same folder,
then you will have a problem. There will be a version conflict and the
compiler won't tell you about it. (In later versions, CCS added a check
for a version mismatch and will give you a warning).

Here's a thread where I first discovered this:
http://www.ccsinfo.com/forum/viewtopic.php?t=19614

My suggestion is to get rid of the older 3.059 and re-install PCW 3.190.
Try the program that I posted above, and see if it now works.
Guest








Start up problem
PostPosted: Wed Oct 04, 2006 8:07 am     Reply with quote

This is the code I used as a test.

#include <16F84.h>
#use delay(clock=4000000)
#fuses XT,NOWDT,NOPROTECT,PUT
#define red_led PIN_B0
#define green_led PIN_B1

void main()
{

while(true)
{
output_low(red_led);
output_high(green_led);
delay_ms(500);
output_high(red_led);
output_low(green_led);
}

}

The red led would illuminate and the green led would not, as expected, and nothing else would happen. I checked the outputs of the two pins driving the leds and the voltages were correct.
alchazz



Joined: 03 Oct 2006
Posts: 13

View user's profile Send private message

Start up problem
PostPosted: Wed Oct 04, 2006 8:29 am     Reply with quote

Embarassed

500 mS after my previous post, I noticed the error.

I reprogrammed and then tried the circuit. And still no go.

Then.....as I moved my hand close to the breadboard, the thing started to work! I moved my hand away, and it stopped. Hmmm.

So, I rearranged the leads more carefully on the breadboard and now it works every time.

Arrggghh!
alchazz



Joined: 03 Oct 2006
Posts: 13

View user's profile Send private message

Start up problem
PostPosted: Fri Oct 13, 2006 2:16 pm     Reply with quote

Wow, looks like a lot of people are looking at my thread.

Are you all having start up problems with your programs and/or devices?

Smile
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Fri Oct 13, 2006 4:03 pm     Reply with quote

When I used resonators/crystals very early on, my rule was always to keep the crystal/caps as close to the chip as possible. Never have leads from the chip to the crystal longer than 1/4-1/2 inch. This is especially true as you go up in frequency.

I now buy oscillator half cans for a buck a piece. These always start, I get guaranteed freq accuracy and don't have to worry about caps or circuit influence. However, I still always use good high frequency layout rules. One advantage, if you socket the can the frequency can be easily changed any time you wish.
bill147



Joined: 26 Oct 2004
Posts: 13

View user's profile Send private message

PostPosted: Sat Oct 14, 2006 11:24 am     Reply with quote

Some years ago I had this same problem. There was a note on the Microchip web site that said when using a crystal the 2 bypass capacitors should not be the same value. For example if you use a 18pf on osc in and a 22pf on osc out then you will not have a startup problem.

Bill
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