CCS Compiler

Started by June 25, 2004
Anyone here ever use the CCS C Compiler for the PIC? I'm attempting
to use the "ADXL210.C" file, and its telling me that I need to
have "#DEVICE" in that file... any ideas?

Thanks,
Shamoon



The ADXL201.C file is just a device driver, you will actually need to
write an application arround that driver.

~Duane

On Fri, 25 Jun 2004 19:27:20 -0000, <> wrote:
>
> Anyone here ever use the CCS C Compiler for the PIC? I'm attempting
> to use the "ADXL210.C" file, and its telling me that I need to
> have "#DEVICE" in that file... any ideas?
>
> Thanks,
> Shamoon > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
> Yahoo! Groups Links




How do I write an application around the driver... rahter... how do
I include the driver in a meaningful fashion? --- In , Duane Mohney <dpmohne@g...> wrote:
> The ADXL201.C file is just a device driver, you will actually need
to
> write an application arround that driver.
>
> ~Duane
>
> On Fri, 25 Jun 2004 19:27:20 -0000, honamos@y... <honamos@y...>
wrote:
> >
> > Anyone here ever use the CCS C Compiler for the PIC? I'm
attempting
> > to use the "ADXL210.C" file, and its telling me that I need to
> > have "#DEVICE" in that file... any ideas?
> >
> > Thanks,
> > Shamoon
> >
> >
> > to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions
> > Yahoo! Groups Links
> >
> >
> >
> >
> >





I'm writing a program using the INPUT.C driver file.. the error that
I get is:

Executing: "C:\Program files\Picc\CCSC.exe" "serout.c" +FH +DF +LN
+T -A +M +Z +Y=9 +EA
>>> Warning 203 "C:\Documents and Settings\Student\My
Documents\Shamoon\PIC\Serout\serout.c" Line 16(1,1): Condition
always TRUE
Memory usage: ROM=2% RAM=3% - 3%
0 Errors, 1 Warnings.
Executing: "C:\Program files\Picc\CCSC.exe" "INPUT.C" +FH +DF +LN
+T -A +M +Z +Y=9 +EA
*** Error 128 "C:\Documents and Settings\Student\My
Documents\Shamoon\PIC\Serout\INPUT.C" Line 14(1,2): A #DEVICE
required before this line
Halting build on first failure as requested.
BUILD FAILED: Mon Jun 28 11:21:11 2004 My code is:

#include <input.c>
#include <string.h>

void main()
{
//set_tris_b(0x00);
char string[30], password[8];

strcpy(password, "palash");
while(true)
{
delay_ms(500);
output_high(PIN_B0);
printf("Password: ");
gets(string);
if(strcmp(string, password))
printf("Good Job\r\n");
else
printf("WAY OFF!!!\r\n");
.... etc Any ideas?

You guys have all been such a great help, I really appreciate all
the assistance.



Problem solved. Thanks anyway! :)

--- In , honamos@y... wrote:
> I'm writing a program using the INPUT.C driver file.. the error
that
> I get is:
>
> Executing: "C:\Program files\Picc\CCSC.exe" "serout.c" +FH +DF +LN
> +T -A +M +Z +Y=9 +EA
> >>> Warning 203 "C:\Documents and Settings\Student\My
> Documents\Shamoon\PIC\Serout\serout.c" Line 16(1,1): Condition
> always TRUE
> Memory usage: ROM=2% RAM=3% - 3%
> 0 Errors, 1 Warnings.
> Executing: "C:\Program files\Picc\CCSC.exe" "INPUT.C" +FH +DF +LN
> +T -A +M +Z +Y=9 +EA
> *** Error 128 "C:\Documents and Settings\Student\My
> Documents\Shamoon\PIC\Serout\INPUT.C" Line 14(1,2): A #DEVICE
> required before this line
> Halting build on first failure as requested.
> BUILD FAILED: Mon Jun 28 11:21:11 2004 > My code is:
>
> #include <input.c>
> #include <string.h>
>
> void main()
> {
> //set_tris_b(0x00);
> char string[30], password[8];
>
> strcpy(password, "palash");
> while(true)
> {
> delay_ms(500);
> output_high(PIN_B0);
> printf("Password: ");
> gets(string);
> if(strcmp(string, password))
> printf("Good Job\r\n");
> else
> printf("WAY OFF!!!\r\n");
> .... etc > Any ideas?
>
> You guys have all been such a great help, I really appreciate all
> the assistance.




The simplest program to write in CCS might be the following:

#include <16F877.h>
#use delay(clock 000000)
#fuses HS, NOLVP, NOWDT,

void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);

while(true)
{
//produce a 50% duty cycle 5 Hz square wave
output_high(PIN_B1);
delay_ms(100);
output_low(PIN_B1);
delay_ms(100);
}
}

This produces square wave output on pin B1.

This includes the approperiate header for the PIC in use, declares the
clock rate, and sets the fuses for this situation:
HS= High Speed Crystal
NOLVP = No Low Voltage Programming
NOWDT = No Watchdog Timer

The main block of main is created the the PICC wizard, then I
inserted the while loop to have the program run indefinitely.

Hopefully this will give you a little more direction.

Duane

On Mon, 28 Jun 2004 16:25:08 -0000, <> wrote:
>
> I'm writing a program using the INPUT.C driver file.. the error that
> I get is:
>
> Executing: "C:\Program files\Picc\CCSC.exe" "serout.c" +FH +DF +LN
> +T -A +M +Z +Y=9 +EA
> >>> Warning 203 "C:\Documents and Settings\Student\My
> Documents\Shamoon\PIC\Serout\serout.c" Line 16(1,1): Condition
> always TRUE
> Memory usage: ROM=2% RAM=3% - 3%
> 0 Errors, 1 Warnings.
> Executing: "C:\Program files\Picc\CCSC.exe" "INPUT.C" +FH +DF +LN
> +T -A +M +Z +Y=9 +EA
> *** Error 128 "C:\Documents and Settings\Student\My
> Documents\Shamoon\PIC\Serout\INPUT.C" Line 14(1,2): A #DEVICE
> required before this line
> Halting build on first failure as requested.
> BUILD FAILED: Mon Jun 28 11:21:11 2004
>
> My code is:
>
> #include <input.c>
> #include <string.h>
>
> void main()
> {
> //set_tris_b(0x00);
> char string[30], password[8];
>
> strcpy(password, "palash");
> while(true)
> {
> delay_ms(500);
> output_high(PIN_B0);
> printf("Password: ");
> gets(string);
> if(strcmp(string, password))
> printf("Good Job\r\n");
> else
> printf("WAY OFF!!!\r\n");
> .... etc
>
> Any ideas?
>
> You guys have all been such a great help, I really appreciate all
> the assistance. > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
> Yahoo! Groups Links