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

10f206

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



Joined: 15 Sep 2009
Posts: 4

View user's profile Send private message

10f206
PostPosted: Tue Sep 15, 2009 7:00 am     Reply with quote

hallo I am begin program my new pic 10f206 and I have test same code blink led in this forum, but never is good. There is same code correct so I begin ?

Code:

#include <10F206.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOMCLR                     //Master Clear pin: disable
#FUSES NOPROTECT                  //Code protected from reads
#use delay(clock=4000000)

#define LED PIN_B0

main()
{
    int32   timer;

    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
    setup_comparator(NC_NC);

    output_low(PIN_B0);
    output_low(PIN_B1);
    output_low(PIN_B2);
    output_low(PIN_B3);

//    delay_ms(500);    // <--- uncomment this and we will *never* get below this code

    while(true)
    {
        output_high(LED);   // LED DOES turn on
        delay_ms(500);      // locked up?
        output_low(LED);    // never makes it here...
        delay_ms(500);
    }
}

I have tried this but don't work.
Thanks everyone.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 15, 2009 12:47 pm     Reply with quote

Post your compiler version. It's a number in this format: x.xxx
It's given at the top of the .LST file, which is in your project directory.
Guest








PostPosted: Wed Sep 16, 2009 1:37 am     Reply with quote

CCS PCB C Compiler, Version 4.084
albe9990



Joined: 15 Sep 2009
Posts: 4

View user's profile Send private message

PostPosted: Wed Sep 16, 2009 1:45 am     Reply with quote

sorry CCS PCB C Compiler, Version 4.084


and in the Pickit2 when i open file write :
no configurations world in hex file ...
albe9990



Joined: 15 Sep 2009
Posts: 4

View user's profile Send private message

PostPosted: Wed Sep 16, 2009 4:38 am     Reply with quote

Now I have test this code:
Code:

#include <10F206.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOMCLR                     //Master Clear pin: disable
#FUSES NOPROTECT                  //Code protected from reads
#use delay(clock=4000000)

main()
{
    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
    setup_wdt(WDT_2304MS);

    while(1)
    {
        output_high(PIN_B2);    // turn on LED
        restart_wdt();
        delay_ms(100);           // lets delay.
        output_low(PIN_B2);     // turn off LED
        restart_wdt();
        delay_ms(100);           // lets delay.
    }
}

and the led came to blink and all is good

but without wdt nothing to.
stop in the first delay.
Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 16, 2009 4:17 pm     Reply with quote

I don't understand your post. Is there a problem with the Watchdog
Timer ?

I only have the version of PCB that comes with MPLAB. It's vs. 4.073.
I compiled the following program and looked at the .LST file. It looks OK.
I think this program should work.
Code:

#include <10F206.H>
#fuses NOWDT,NOMCLR
#use delay(clock=4000000)

//=========================
void main()
{
setup_comparator(NC_NC);

// Blink an LED on pin B2.
while(1)
  {
   output_high(PIN_B2);
   delay_ms(500);
   output_low(PIN_B2);
   delay_ms(500);
  }

}
albe9990



Joined: 15 Sep 2009
Posts: 4

View user's profile Send private message

PostPosted: Wed Sep 16, 2009 5:05 pm     Reply with quote

now is good with mplab.
and led blink.
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