View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 03, 2006 1:03 pm |
|
|
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 |
Posted: Wed Oct 04, 2006 8:07 am |
|
|
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
|
Start up problem |
Posted: Wed Oct 04, 2006 8:29 am |
|
|
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
|
Start up problem |
Posted: Fri Oct 13, 2006 2:16 pm |
|
|
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?
|
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Fri Oct 13, 2006 4:03 pm |
|
|
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
|
|
Posted: Sat Oct 14, 2006 11:24 am |
|
|
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 |
|
|
|