1/30/2013

EXAMPLE 02 : 7 Segments LED

EXAMPLE_02.bas

$regfile = "89s8252.dat"
$crystal = 11592000
Dim I As Byte
Dim Number(10) As Byte


Restore Db
  For I = 1 To 10
  Read Number(i)
  Next

Do
 For I = 1 To 10
 P0 = Number(i)
 Waitms 200
 Next
Loop

End



Db:                                                                                                             '1234567890
Data &HF9 , &HA4 , &HB0 , &H99 , &H92 , &H83 , &HF8 , &H80 , &H98 , &HC0 



1/27/2013

EXAMPLE 01 : Flowing Water LED


EXAMPLE_01.bas

$regfile = "89s8252.dat"
$crystal = 12000000

Do
'=====================
 P0 = &B11111110
 Waitms 100
 P0 = &B11111101
 Waitms 100
 P0 = &B11111011
 Waitms 100
 P0 = &B11110111
 Waitms 100
 P0 = &B11101111
 Waitms 100
 P0 = &B11011111
 Waitms 100
 P0 = &B10111111
 Waitms 100
 P0 = &B01111111
 Waitms 100
'==========================
 P0 = &B10111111
 Waitms 100
 P0 = &B11011111
 Waitms 100
 P0 = &B11101111
 Waitms 100
 P0 = &B11110111
 Waitms 100
 P0 = &B11111011
 Waitms 100
 P0 = &B11111101
 Waitms 100
Loop

End 



EXAMPLE_01a.bas 


$regfile = "89s8252.dat"
$crystal = 12000000
Dim A As Byte
Dim I As Byte

A = &B11111110

Do
 For I = 1 To 7
  P0 = A
  Wait 1
  Rotate A , Left , 1
Next

 For I = 1 To 7
  P0 = A
  Wait 1
  Rotate A , Right , 1
 next
Loop

End




EXAMPLE 00 : Stared From Flash LED

EXAMPLE_00.bas

$regfile = "89s8252.dat"
$crystal = 12000000

Do
  P1.0 = 0
  Wait 1
  P1.0 = 1
  Wait 1
Loop

End





1/26/2013

AT89S52 Pin Configurations



Features
• Compatible with MCS®-51 Products
• 8K Bytes of In-System Programmable (ISP) Flash Memory
   – Endurance: 10,000 Write/Erase Cycles
• 4.0V to 5.5V Operating Range
• Fully Static Operation: 0 Hz to 33 MHz
• Three-level Program Memory Lock
• 256 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-bit Timer/Counters
• Eight Interrupt Sources
• Full Duplex UART Serial Channel
• Low-power Idle and Power-down Modes
• Interrupt Recovery from Power-down Mode
• Watchdog Timer
• Dual Data Pointer
• Power-off Flag
• Fast Programming Time
• Flexible ISP Programming (Byte and Page Mode)
• Green (Pb/Halide-free) Packaging Option