Picplc8a Manual v101

  • Upload
    zap2m

  • View
    236

  • Download
    0

Embed Size (px)

Citation preview

  • 8/16/2019 Picplc8a Manual v101

    1/20

  • 8/16/2019 Picplc8a Manual v101

    2/20

  • 8/16/2019 Picplc8a Manual v101

    3/20

    PICPLC8A KEY FEATURES 4CONNECTING THE SYSTEM 5

    INTRODUCTION 6

    Jumpers 7

    MCU Port 8

    Power Supply 9On-Board USB 2.0 Programmer 10

    RS-232 Communication Circuit 11

    RS-485 Communication Circuit 12

    Optocouplers 13

    Relays 15

    Direct Port Access Connectors 17

    CONTENTS

  • 8/16/2019 Picplc8a Manual v101

    4/20

    PICPLC8A KEY FEATURES

    1. Power supply connector;

    2. Optocouplers, RS-232 and RS-485 connectors;

    3. Jumpers J1-J4 used to enable connection between on-

    board USB 2.0 programmer and microcontroller;

    4. On-board USB 2.0 programmer;

    5. MikroICD;

    6. USB connector;

    7.Optocouplers;

    8. RS-232 communication circuit;

    9. RS-485 communication circuit;

    10. Resistor network 8x10K;

    11. PS/2 connector;

    12. Power supply circuit;

    13. Power supply supervisor circuit;

    14. Reset button circuit;

    15. MCU socket with PIC18F4520 microcontroller;

    16. MCU port’s pull-up/pull-down selectors;

    17. Direct port access connectors;

    18.Relays;

    19. Relay driver circuit; and

    20. Relay connectors.

    4

  • 8/16/2019 Picplc8a Manual v101

    5/20

    C

    O

    C

    N

    T

    H

    S

    Y

    M

    CONNECTING THE SYSTEM

    Apart from this manual, the development system box contains development system, product CD,USB cable, and user's manuals for installing PICflash 2 programmer and USB drivers. In order to

    use PICPLC8A properly, it is necessary to go through the following steps:

    Step no.1 Take the development system and product CD out of the box. Insert the product

    CD into CD drive. Please, do not connect the development system to a PC yet.

    Step no.2 Install PICPLC8A programmer software to enable a program to be trans-ferred from PC to the microcontroller chip. Installation instructions are con/

    tained in the ‘ PICFlash 2 programmer ’ manual.

    Step no.3 Install USB drivers on your PC to enable programmer's hardware to ope-rate properly on the PICPLC8A board. For detailed installation instructions

    refer to the ' Installing USB drivers' manual.

    Step no.4 Connect the PICPLC8A to PC using USB cable. Please use one of USB ports on the back of the PC because they are directly connected to the com

     puter motherboard.

    The first time you switch the PICPLC8A on, your PC will automatically

    detect a new hardware. You will be immediately prompted whether Win-

    dows should search for new drivers update or not. Select the option ' No, not

    this time' and click ' Next '. Another window appears, click 'Next' and theoperating system will automatically find the drivers. Click ' Finish' to com-

     plete this process and run PICFlash 2 as explained in the ‘ PICFlash 2 pro-

     grammer ’ manual.

     Next time you switch the PICPLC8A on, Windows will not ask for new

    drivers update during driver installation. .

    After these four steps, your PICPLC8A is successfully installed and ready for use. You can read

    a program from the chip or write another one into it. The product CD provides numerous sim-

     ple program examples to make your first steps Easy...

    5

  • 8/16/2019 Picplc8a Manual v101

    6/20

    I

    N

    R

    O

    U

    O

    INTRODUCTION

    PICPLC8A is a programmable logic controller design to control devices in industry and auto-matics using relays. It has a built-in programmer so that there is no need for additional hard-

    ware for the microcontroller programming. Besides, this controller has inputs isolated by opto-

    couplers, RS-232 and RS-485 communication modules and PS/2 communication module as

    well. Four IDC-10 male connectors enable the PICPLC8A to be directly connected to the

    microcontroller pins, if needed.

    Figure 1 illustrates the PICPLC8A development system. There are identification marks next to

    each component on a silkscreen, both on the top and bottom. These marks describe connections

    to the microcontroller, operation modes and provide other useful information so that there is

    almost no need for additional schematics.

    6

    Figure 1 PICPLC8A development board

  • 8/16/2019 Picplc8a Manual v101

    7/20

    J

    U

    M

    R

    JUMPERS

    Jumpers are devices used to break or establish connection between two points. Under the plas-tic cover of a jumper, there is a metal contact which establishes connection when the jumper is

     placed over two pins.

    Jumper is commonly used as a selector between two possible connections via 3-pin connector.

    As illustrated in Figure 2, the middle connector pin can be connected to the left or right pin,

    depending on the jumper’s position.

    7

    Figure 2 Jumper as a selector 

    Jumper is not

    placed and

    middle pin isunconnected.

    Jumper is placed

    on the left side

    connecting mid-dle and left pin.

    Jumper is placed

    on the right side

    connecting middleand right pin.

  • 8/16/2019 Picplc8a Manual v101

    8/20

    M

    U

    P

    O

    MCU PORT

    The PICPLC8A supports 40-pin microcontrollers in DIP40

     package (PIC18F4520). See Figure 3. The microcontroller 

     pins are routed to various peripherals. All ports are directly

    connected to Direct Port Access Connectors. These connec-

    tors are normally used for connecting external peripherals to

    the board or as points for connecting digital logic probes.

    Some of the pins are connected to other peripherals such

    as optocouplers, RS-232 communication, RS-485 commu-

    nication, etc.

    8

    Figure 3

    Figure 4

    PICPLC8A MCU socket

    System connection

  • 8/16/2019 Picplc8a Manual v101

    9/20

    P

    O

    W

    E

    R

    S

    U

    Y

    POWER SUPPLY

    The PICPLC8A can use one out of two power supply sources - PICPLC8A

     board power supply and isolated power 

    supply for optocouplers.

    The PICPLC8A power supply can be

    AC or DC. AC power supply voltage

    ranges between 12 and 22V, whereas

    DC power supply voltage ranges

     between 16 and 30V. Isolated power 

    supply for optocouplers is marked with

    OCVCC on the board.

    Note: See optocouplers on page 13.

    9

    Figure 6 Power supply circuit diagram

    Power supplyFigure 5

  • 8/16/2019 Picplc8a Manual v101

    10/20

    O

    B

    O

    U

    B

    2

    0

    P

    R

    O

    M

    R

    ON-BOARD USB 2.0 PROGRAMMER

    There is no need to use external equipment during programming as the PICPLC8A developmentsystem has its own on-board USB 2.0 programmer. All you need to do is to connect the system

    to PC using the USB cable and enable

    Development MODE by setting jumpers

    J1, J2, J3 and J4 in the left hand position.

    Then, load a program into the microcon-

    troller via the PICflash2 programming soft-

    ware supplied with the board.

     

    Figure 7 USB 2.0 programmer 

    Figure 8 USB 2.0 programmer circuit diagram

  • 8/16/2019 Picplc8a Manual v101

    11/20

    R

    2

    C

    O

    M

    C

    O

    C

    R

    U

    T

    RS-232 COMMUNICATION CIRCUIT

    RS-232 communication circuit enables point-to-point data transfer. Itis commonly used in data acquisition applications to transfer data

     between the microcontroller and PC. Since the voltage levels of the

    microcontroller and PC are not directly compatible with each other,

    a level converter such as MAX232 must be used.

     

    Figure 9 RS232 connector 

    Figure 10 RS232 circuit diagram

  • 8/16/2019 Picplc8a Manual v101

    12/20

    R

    4

    C

    O

    M

    C

    O

    C

    R

    U

    T

    RS-485 COMMUNICATION CIRCUIT

    RS-485 communication circuit enables point-to-point data transfer. It is com-monly used to transfer data between several microcontrollers. LTC485 inter-

    face transceiver is used to transform a signal on microcontroller’s Rt, Rx and

    Tx lines into a differential signal on A and B lines.

    The PICPLC8Adevelopment board has one RS-485 communication circuit. In

    order to provide more flexible system, the microcontroller is connected to

    LTC485 via three jumpers (J10,J11 and J12) as shown in Figure 12.

     2

    Figure 11 RS-485 communication circuit

    Figure 12 RS-485 circuit diagram

  • 8/16/2019 Picplc8a Manual v101

    13/20

    O

    O

    O

    E

    R

    OPTOCOUPLERS

    The PICPLC8A has 8 optocouplers inputs. Optocouplers are widely used in industrial applications

    where inputs must be electrically isolated from the rest of the development board. The main objec-

    tive is to protect the microcontroller from voltage spikes that might occur on input lines.

    In order that input circuit is electrically isolated from the rest of the board, it must have its own

     power supply (12V DC).The optocoupler chip has two LEDs on each input and two open col-lector transistors on each output pin. All optocoupler outputs are connected to the microcon-

    troller PORTB. PORTB must be driven high by putting jumper J6 in the upper position (pull-

    up), because optocoupler has open drain output.

     3

    Figure 13 Optocoupler group

  • 8/16/2019 Picplc8a Manual v101

    14/20

    O

    O

    O

    E

    R

     4

    Figure 14 Optocoupler circuit diagram

  • 8/16/2019 Picplc8a Manual v101

    15/20

    R

    A

    RELAYS

    In order to control devices using high power for their operation, the PICPLC8A has 8 relays connect-

    ed to the microcontroller PORTD. The relay coil voltage amounts to 12V DC (+U12).

    The microcontroller PORTD pins cannot provide enough current necessary to directly run

    relays so that they are connected to the ULN2804 Darlington drivers. Each relay has one LEDindicator connected in parallel with its coil. It is used to indicate whether the appropriate relay

    is active or not. There is only normally open contact on each relay’s output (for example W0-

    A and W0-B).

     5

    Figure 15 Relays

  • 8/16/2019 Picplc8a Manual v101

    16/20

    R

    A

     6

       F   i  g  u  r  e

       1   6

       R  e   l  a  y  s  c   i  r  c  u   i   t   d   i  a  g  r  a  m

  • 8/16/2019 Picplc8a Manual v101

    17/20

    D

    R

    C

    P

    O

    A

    C

    O

    C

    O

    DIRECT PORT ACCESS CONNECTORS

    All microcontroller input/output pins can be accessed via IDC-10

    (2x5) connectors placed along the right side of the board. For each

    microcontroller port, there is one 10-pin connector providing up to

    eight port pins and two additional pins connected to VCC and GND.

    These connectors, shown in Figure 17, can be used to connect the

    system to external devices such as Serial Ethernet, Compact Flash,

    keyboard etc. If external and on-board peripherals use the same

     pins, then on-board peripherals must be disconnected from the

    microcontroller by setting the appropriate jumpers. The connectors

    can also be used for attaching logic probes or other test equipment.

     7

    Figure 18 Direct port access circuit diagram

    Figure 17 Direct port access

    connectors

    p  u   t

    c   t  -   o

      rs

       i  s  -

    d  u   l  e

    c   t  o  r

  • 8/16/2019 Picplc8a Manual v101

    18/20

    P

    IC

    P

    L

    C

     

       E  x   t  e  r  n  a   l  p  o  w

      e  r

      s  u  p  p   l  y   1   6   V  -   3   0   V

       D   C

       1   2   V  -   2   2   V

       A   C

       U   S   B   2 .   0

      p  r  o  g  r  a  m  m  e  r

       P  o  w  e  r  s  u  p  p   l  y

      r  e  g  u   l  a   t  o  r

       O  p

       t  o  c  o  u  p   l  e  r  s

       O  p   t  o  c  o  u  p   l  e  r ,   R   S  -   2

       3   2  a  n   d

       R   S   4   8   5  c  o  n  n  e  c   t  o  r

      s

       M   C

       U

       8   M   H  z

      c  r  y  s   t  a   l

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          R                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  e                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   s                 

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      e                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       u                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       h                                                                                                                                                                                                                                                                                                                                                                                                                                                                  -

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          b                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   u                 

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   n

       R  e   l  a  y  s

       J  u  m  p  e  r  s   t  o

       d  e   t  e  r  m   i  n  e   i  n  p

      p   i  n  p  e  r   f  o  r  m  -

      a  n  c  e   i  n   i   d   l  e

      s   t  a   t  e   (  c  o  n  n  e  c

      e   d   t  o  p  u   l   l  -  u  p

      p  u   l   l  -   d  o  w  n  r  e  s

       t  o  r  s   )

       R   S  -   4   8   5  m  o   d

      c  o  n  n  e  c   t  o  r

       P   S   /   2  c  o  n  n  e  c

       P  o  w  e  r  s  u  p  p   l  y

      s  u  p  e  r  v   i  s  o  r

       R   S

      -   2   3   2

      m  o   d  u   l  e

      w   i   t   h

      s  e   l  e  c   t  a   b   l  e   T   X  a  n   d   R   X

       M   C   U

       i  n   D   I   P   4   0  p  a  c   k  a  g  e

       R  e   l  a  y  s   i  n  p  u   t   /  o  u   t  p  u   t  c  o  n  n  e  c   t  o

      r  s

       U   S   B   2 .   0

      c  o  n  n  e  c   t  o  r

       D   i  r  e  c   t

      p  o  r   t

      a  c  c  e  s  s

  • 8/16/2019 Picplc8a Manual v101

    19/20

  • 8/16/2019 Picplc8a Manual v101

    20/20