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

Can not setup wdt on 16F886

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



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

Can not setup wdt on 16F886
PostPosted: Fri May 09, 2008 9:21 pm     Reply with quote

#include <16F886.h>
#fuses wdt
.
.


setup_wdt(WDT_2304MS);

Why CCS can not compile ?

Thanks
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

PostPosted: Fri May 09, 2008 9:36 pm     Reply with quote

#include <16F886.h>
#device ADC=10
.
.
.

// Pins A0 and A1 are analog and all others are digital.
//The +5v is used as a reference.
setup_adc_ports( RA0_RA1_ANALOG );
setup_adc(ADC_CLOCK_INTERNAL );
set_adc_channel( 0 );
delay_us(10);
value = read_adc();

Why CCS compile error at setup_adc_ports( RA0_RA1_ANALOG ); ?

Regards
Ttelmah
Guest







PostPosted: Sat May 10, 2008 3:22 am     Reply with quote

What compiler version?.

For the second, the ADC on this is different from most, allowing the pins to be _individually_ specified, in any combination (instead of having the limited list of selectable 'patterns' normally present). Hence the syntax for this chip, is:

setup_adc_ports( sAN0 | sAN1 );
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

PostPosted: Sat May 10, 2008 10:17 am     Reply with quote

Quote:
What compiler version?

- PCWH Compiler V4.018

- setup_adc_ports( sAN0 | sAN1 );-----> Ohh! good .It's work.

Thank you for your knowledge
Ttelmah
Guest







PostPosted: Sun May 11, 2008 2:07 am     Reply with quote

Unfortunately, 4.018, is 'before' the versions of V4, that worked reasonably....
My guess would be that the watchdog setup in this version is faulty. The earliest 'working' V4 compilers (that could compiler 90+%of code, and have a good chance of it running), were around the early 4.03x versions. Look at the sticky thread at the top of the forum, for a 'history' of the V4 problems.
I'd suggest you contact CCS support, pointing out that the watchdog setup doesn't work on your version for this chip, and hopefully they'll let you download a 'modern' version with this fixed.

Best Wishes
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

PostPosted: Mon May 12, 2008 6:57 am     Reply with quote

Ttelmah wrote:
Unfortunately, 4.018, is 'before' the versions of V4, that worked reasonably....
My guess would be that the watchdog setup in this version is faulty. The earliest 'working' V4 compilers (that could compiler 90+%of code, and have a good chance of it running), were around the early 4.03x versions. Look at the sticky thread at the top of the forum, for a 'history' of the V4 problems.
I'd suggest you contact CCS support, pointing out that the watchdog setup doesn't work on your version for this chip, and hopefully they'll let you download a 'modern' version with this fixed.

Best Wishes


Really! CCS Compiler V.4.057 can compile setup_wdt(WDT_2304MS);
thanks
You very excellent.I'm regards.
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