Searching \ for '[PIC]: CCS C Example' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=c
Search entire site for: 'CCS C Example'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: CCS C Example'
2001\07\26@175022 by kben

picon face
Hi,
Could somebody send me an example of a (simple)working CCS C source program
for a F84 (RS232 maybe), or a website that has a couple of examples.
I have been using assembler and am new to CCS C. I have some experience with

Turbo C, but can't seem to get anything working with CCS C. I am not sure if
it's me or the compiler.

Thanks in advance,
                Kevin

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\07\26@183545 by Mike Mansheim

flavicon
face
> Could somebody send me an example of a (simple)working CCS C source
> program for a F84 (RS232 maybe)...
> ...but can't seem to get anything working with CCS C.

Well, I've got lots of working CCS C programs, but none for the F84 or
with RS232.  You're welcome to send me (direct) what you've got that
isn't working, and I can tell you if it's something obvious.
Also, is it a problem with the development environment, or getting the
program to compile, or getting a compiled program to run properly,
or ???
Let me know if you would like to see something more complex, but
here's a real simple program that will blink an led attached to RC7,
for a chip (16F876) and crystal (10M) I've used:

5V --> led --> 750 ohm --> RC7

#case     // makes compiler case sensitive
#include "c:\picc\examples\16F876.h"

// set configuration bits:
#fuses HS, NOWDT, PUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, WRT

#byte PORTA = 0x05
#byte PORTB = 0x06
#byte PORTC = 0x07

#bit LED = PORTC.7

void INITIALIZE(void);           // prototype

#use delay(clock = 10000000)     // 10M clock

void main(void)
{
   INITIALIZE();

   while(1)
   {
       if (LED) LED = 0;
       else     LED = 1;
       delay_ms(500);
   }
}

void INITIALIZE(void)
{
   // set RC7 as output (and high)
   // since rest are unknown, set as outputs (and low)

   setup_adc_ports(NO_ANALOGS);
   PORTA = 0;
   set_tris_a(0);

   PORTB = 0;
   set_tris_b(0);

   PORTC = 0b10000000;       // init LED off
   set_tris_c(0);
}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\07\26@191646 by kben

picon face
Well must be ME, because that compiled fine.
I will take you up on your offer and contact you offlist.
Thanks

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...