Professional Documents
Culture Documents
Deoghar
Tutorial 8051 Micro Controller
Made By - RAPIER07
From the figure given below it is apparent that the 89S52 has 4
ports each port having 8 pins (I/O Lines). Hence there are total
32 pins for I/O.
Total no. of pins = 40(for a standard 8051)
40 = 4x8 + 2 + 2 + 1 + 1 + 2
4x8 for the I/O lines
2 for the ground and Vcc (pin no. 20 and 40 respectively)
2 for the external oscillator circuit for regulating or generating
the clock of the processor (you can skip this since the AVR
unlike the 8051 has the oscillator inbuilt) these are pins 18, 19.
1 for reset (pin no. 9)
1+2 (these 3 pins are meant for use of external memory and
not the inbuilt EEPROM or RAM). These are pins 29, 30, 31.
Just remember that 31 must be set at +5V to tell the controller
that internal memory is to be used.
Embedded C
Variables:
Data Type Bits Bytes Value Range
bit 1 -- 0 to1
unsigned char 8 1 0-255
signed char 8 1 -128 to 127
unsigned int 16 2 0-65535
signed int 16 2 -32768-32767
unsigned long 32 4 0-(2^32-1)
signed long 32 4 Figure the
math out
yourself
Float 32 4 Basically
decimals
Constants: