PIC Lesson: Seven Segment

June 25th, 2009  Posted at   Lesson PIC

Bagaimana anda ingin menyalakan 7 Segment atau membuat kiraan nombor?
Langkah pertama anda perlu tahu cara sambungannya. Untuk di sambungkan kepada Microcontroller PIC, anda boleh memilih sama ada menggunakan 7 segment Common anode atau Common Cathode. Sambungannya seperti di bawah.

Anda perlu memberi signal yang betul untuk menunjukkan nombor di 7 segment. Berikut adalah jadual penukaran daripada nombor decimal kepada kod 7 segment.

DECIMAL 7 SEGMENT
A3 A2 A1 A0 a b c d e f g
0 0 0 0 1 1 1 1 1 1 0
0 0 0 1 0 1 1 0 0 0 0
0 0 1 0 1 1 0 1 1 0 1
0 0 1 1 1 1 1 1 0 0 1
0 1 0 0 0 1 1 0 0 1 1
0 1 0 1 1 0 1 1 0 1 1
0 1 1 0 1 0 1 1 1 1 1
0 1 1 1 1 1 1 0 0 0 0
0 0 0 0 1 1 1 1 1 1 1
1 0 0 1 1 1 1 1 0 1 1

Di bawah adalah videonya

PIC Source Code

7 Responses to “PIC Lesson: Seven Segment”

  1. shivendra kumara sahu says:

    here not show any PIC Source Code

  2. Vito says:

    PS: of course I used the Hi-Tech C compiler in MPLAB. :-)

  3. Vito says:

    I created the hex file with MPLAB 8.86, but once simulated RealPic Simulator 1.3, are not displayed correctly number from 0 to 9.
    Where did I go wrong?
    Thank you.
    This is my hex (seven_segments.hex):

    :100000000A128A11832F00308A000408840A8207AA
    :1000100000347E3430346D34793433345B345F34BF
    :0600200070347F347B34D4
    :100F060083010A128A11BD2F8316031788018901EE
    :100F1600080083160313850186018701880189016C
    :100F26000A128A1187270A128A118312031385016E
    :100F360086018701880189010800F401F501B12FB6
    :100F46000730F3007D30F200F20BA72FF30BA72F2B
    :100F56000130F4070318F50A0030F5077108750229
    :100F6600031DB72F70087402031CBA2FBB2FA32FC3
    :100F7600BC2F08000A128A118C270A128A11C32F65
    :100F8600F601F7017708803AFF0080307F02031DE3
    :100F9600CE2F0A307602031CD12FD22FD42FC32F87
    :100FA600C32F7608013E84000A128A1103200A1212
    :100FB6008A11831203138800E830F0000330F10031
    :100FC6000A128A11A0270A128A110130F60703189D
    :100FD600F70A0030F7077708803AFF0080307F0273
    :100FE600031DF72F0A307602031CFA2FFB2FD42F8E
    :0A0FF600C32FC32F0A128A1100282E
    :02400E00E2ECE2
    :00000001FF

    File seven_segments.rpp of RealPic Simulator 1.3:

    [Real Pic Simulator]
    Version=1.3.0.0
    HexFile=seven_segments.hex
    Processor=16F887
    RealFrequency=20000000
    SimFrequency=20000000
    [Visual]
    Component0=07,003E,002B,000000008300008083010081830200828303008383040084830500858306008685002000

  4. fatimah says:

    saya nak tanya, saya dah try burn program ni dalam pic, tapi….tak dapat

  5. fatimah says:

    mcm mana nak tahu beza
    __CONFIG(0x3F3A);

    AND

    _CONFIG ( 0x3F32 );

    saya try wat 7 segment guna yg kedua tak dapat

  6. titan says:

    uiks. ini ilmu baru nih..

Leave a Reply

What is 11 + 15 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)