View previous topic :: View next topic |
Author |
Message |
sorasit46
Joined: 07 May 2007 Posts: 69
|
Can not setup wdt on 16F886 |
Posted: Fri May 09, 2008 9:21 pm |
|
|
#include <16F886.h>
#fuses wdt
.
.
setup_wdt(WDT_2304MS);
Why CCS can not compile ?
Thanks |
|
|
sorasit46
Joined: 07 May 2007 Posts: 69
|
|
Posted: Fri May 09, 2008 9:36 pm |
|
|
#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
|
|
Posted: Sat May 10, 2008 3:22 am |
|
|
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
|
|
Posted: Sat May 10, 2008 10:17 am |
|
|
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
|
|
Posted: Sun May 11, 2008 2:07 am |
|
|
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
|
|
Posted: Mon May 12, 2008 6:57 am |
|
|
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. |
|
|
|