본문 바로가기

자료수집

atmega128 16bit씩 shift parsing법 -by 키트

long Tempdata, high, low; // 세개 변수가 모두 long으로 선언 되었든지

//

long Tempdata; // 하나만 long으로 선언 되고

int high, low; // 두개는 int로 선언 한 후

 

Tempdata = (high<<16) | low; // 세개다 long형이면 이 연산이면 되고=

Tempdata = ((long)high<<16) | low; // high, low가 int형이면 이 연산으로 하면 됩니다.

 

 

 

비트연산 사용하지 않고 산술연산자를 사용하는 경우는

Tempdata = ((long)high*65536) + low;

 

 

 

Data Types
Previous Top Next


The following table lists all the data types supported by the CodeVisionAVR C compiler, their range of possible values and their size:
  
Type
Size (Bits)
Range
bit
1
0 , 1
bool, _Bool
8
0 , 1
char
8
-128 to 127
unsigned char
8
0 to 255
signed char
8
-128 to 127
int
16
-32768 to 32767
short int
16
-32768 to 32767
unsigned int
16
0 to 65535
signed int
16
-32768 to 32767
long int
32
-2147483648 to 2147483647
unsigned long int
32
0 to 4294967295
signed long int
32
-2147483648 to 2147483647
float
32
±1.175e-38 to ±3.402e38
double
32
±1.175e-38 to ±3.402e38

The bit data type is not allowed as the type of an array element or structure/union member.
If the Project|Configure|C Compiler|Code Generation|char is unsigned option is checked or #pragma uchar+ is used, then char has by default the range 0..255.
 
코드비젼 헬프의 레퍼런스에서 복사해온 데이터형입니다
16비트 = 2바이트
32비트 = 4바이트