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

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Entering Binary Numbers in CCS C'
2003\04\17@101256 by Mccauley, Daniel H

flavicon
face
Been having difficulty looking this one up.

Using CCS C Compiler:

Instead of writing a line such as:   DATA = 0x01;
I would like to enter the data as binary instead of hex.

How would I write this out?

Any help appreciated.
Thanks

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

2003\04\17@101819 by Dale Botkin

flavicon
face
On Thu, 17 Apr 2003, Mccauley, Daniel H wrote:

> Instead of writing a line such as:   DATA = 0x01;
> I would like to enter the data as binary instead of hex.
>
> How would I write this out?

DATA = 0b00000001;

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

2003\04\17@105334 by Bob Ammerman

picon face
And for any ANSI C compiler that does not support binary constants.....

#define B(a,b,c,d,e,f,g,h)    \
( ((a)<<7) | ((b)<<6) | ((c)<<5) |     \
 ((d)<<4) | ((e)<<3) | ((f)<<2) |    \
 ((g)<<1) | ((h)<<0) )

   DATA = B(0,0,0,0,0,0,0,1);

Bob Ammerman
RAm Systems


{Original Message removed}

2003\04\17@211301 by John Hansen

picon face
Use:

DATA = 0b00000001;

At 10:12 AM 4/17/03 -0400, Mccauley, Daniel H wrote:
>Been having difficulty looking this one up.
>
>Using CCS C Compiler:
>
>Instead of writing a line such as:   DATA = 0x01;
>I would like to enter the data as binary instead of hex.

--
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 2003 , 2004 only
- Today
- New search...