Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

about data type in pic c compiler????????

Status
Not open for further replies.

osha

Member level 2
Joined
Nov 20, 2005
Messages
42
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
egypt
Activity points
1,623
iused pic 16f877a

iwant to know how i can define constant array in pic c compiler?

and are byte=unsigend char?
 

happy2005

Member level 3
Joined
Mar 14, 2005
Messages
64
Helped
10
Reputation
20
Reaction score
3
Trophy points
1,288
Location
Turkiye
Activity points
1,940
const rom int pwm_ref[6]= {0,8,17,25,33,42};
rom : it says the compiler that the array allocated in program memory, not data memory. if you omit "rom", the variable allocated in data mem.
int: each number in array has 16-bit wide. use "int" even the number is 8-bit. Because it generates more compact code after compile.

No, char is a byte. But signed byte.

char --> 8-bit signed variable. (range : -128,-127)
unsigned char --> 8-bit unsigned variable (0,255)
int --> 16-bit signed (-32768, -32767)
unsigned int --> 16-bit unsigned (0,65536)
long --> 32-bit signed
unsigned long --> 32-bit unsigned
double --> 64-bit signed
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top