1st Edition

PIC16F1847 Microcontroller-Based Programmable Logic Controller Advanced Concepts

By Murat Uzam Copyright 2021
    586 Pages 424 B/W Illustrations
    by CRC Press

    586 Pages 424 B/W Illustrations
    by CRC Press

    The PIC16F1847-Based PLC project supports up to 4 analog inputs and 1 analog output, 1 High Speed Counter, 2 PWM (pulse width modulation) outputs, 1 Drum Sequencer Instruction with up to 16 steps, the implementation of Sequential Function Charts (SFCs) with up to 24 steps. This volume presents advanced concepts of the PIC16F1847-Based PLC project and consists of topics like program control, high speed counter and PWM macros. It further explains memory related drum sequencer instruction, sequential functional charts, and analog input and output modules. Aimed at researchers and graduate students in electrical engineering, power electronics, robotics and automation, sensors, this book:

    Presents program control macros to enable or disable a block of PLC program or to move execution of a program from one place to another.

    Proposes a High-Speed Counter and four PWM Macros for high speed counting and PWM operations.

    Develops memory related macros to enable the user to do memory read/write operations.

    Provides a Drum Sequencer instruction with up to 16 steps and 16 outputs on each step.

    Discusses the implementation of Sequential Function Chart (SFC) elements with up to 24 steps.

    Chapter 1 – Program Control Macros
     1.1 Jump Instructions
     1.2 Macro “jump” (Jump to Label)
     1.3 Macro “jumpN” (Jump to Label)
     1.4 Macro “jmp_lst_2” (Jump to One of Two Labels)
     1.5 Macro “jmp_lst_4” (Jump to One of  Four Labels)
     1.6 Macro “jmp_lst_8” (Jump to One of Eight labels)
     1.7 Macro “call_SR” (Call Subroutine)
     1.8 Macro “return_SR” (Return from Subroutine)
     1.9 Macro “FOR” (Beginning of For-Next Loop)
     1.10 Macro “NEXT” (End of For-Next Loop)
     1.11 Macro “clear_WDT” (Clear the Watchdog Timer)
     1.12 Implementation of Master Control Relay (MCR)
     1.13 Examples for Program Control Macros
     1.14 References

    Chapter 2 – High Speed Counter and PWM Macros
     2.1 High Speed Counter (HSC) Instruction
     2.2 PWM Overview
     2.3 Using Standard PWM Functions
     2.4 Macro “PWM_RA4v” (A Standard PWM Operation with a Variable Duty Cycle
    by Using the RA4 Pin)
     2.5 Macro “PWM_RA4c” (A Standard PWM Operation with a Fixed Duty Cycle by Using the RA4 Pin)
     2.6 Macro “PWM_RA7v” (A Standard PWM Operation with a Variable Duty Cycle
    by Using the RA7 Pin)
     2.7 Macro “PWM_RA7c” (A Standard PWM Operation with a Fixed Duty Cycle by Using the RA7 Pin)
     2.8 Some Control Circuits for the Brushed DC Motor
     2.9 Examples for High Speed Counter and PWM Macros
     2.10 References

    Chapter 3 – Memory Related Macros
     3.1 Memory Organization of PIC16F1847 Microcontroller
     3.1.1 Flash Program Memory Organization
     3.1.2 Data SRAM Memory Organization
     3.2 Introduction to Memory Read/Write Operations
     3.3 Macro “sram_read” (Read 1 Byte from SRAM Memory)
     3.4 Macro “eeprom_read” (Read 1 Byte from EEPROM Memory to SRAM Memory)
     3.5 Macro “copy_eeprom_to_sram” (Copy N Bytes from EEPROM Memory to
    SRAM Memory)
     3.6 Macro “eeprom_write” (Write 1 Byte from SRAM Memory to EEPROM Memory)
     3.7 Macro “write_sram_to_eeprom” (Write N Bytes from SRAM Memory to EEPROM Memory)
     3.8 Macro “prg_mem_read” (Read 1 Word from Flash Program Memory)
     3.9 Macro “copy_prgmem_to_sram” (Copy N Bytes from Flash Program Memory to SRAM Memory)
     3.10 Macro “prg_mem_erase” (Erase N Rows of Flash Program Memory)
     3.11 Macro “write_B_sram_to_prgmem” (Write Bytes from SRAM Memory to Flash Program Memory)
     3.12 Macro “write_W_sram_to_prgmem” (Write Words from SRAM Memory to Flash Program Memory)
     3.13 Macro “fill_sram_N80” (Fill up to 80 Variables with Values in a Bank)
     3.14 Macro “fill_sram_N255” (Fill up to 255 Variables with Values in SRAM Memory)
     3.15 Examples for Memory Related Macros
     3.16 Reference

    Chapter 4 – Drum Sequencer Instruction
     4.1 Implementation of the Drum Sequencer Instruction
     4.2 Examples for the Drum Sequencer Instruction
     4.3 References

    Chapter 5 – Sequential Function Charts
     5.1 Introduction to SFC
     5.2 Implementation of SFC Elements
     5.3 References

    Chapter 6 – Analog Input Modules and Analog Output Modules (Available as E-Ancillaries)
     6.1 Analog Input Modules
     6.2 Analog Output Modules
     6.3 Example 6.1 – Test Program for Analog Input Modules
     6.4 Test Circuits for Analog Input Modules
     6.5 Example 6.2 – Test Program for Analog Output Modules
     6.6 Test Circuits for Analog Output Modules
     6.7 Example 6.3 – Test Program for Using Analog Output Modules together with the PWM Output PWM_RA4
     6.8 Test Circuits for Using Analog Output Modules together with the PWM Output PWM_RA4
     6.9 References


    Appendix A - List of Components for Boards and Modules (Available as E-Ancillaries)
     Table A.1. Some example universal double sided prototyping printed circuit boards (PCBs) that can be used for the modules developed in this book
     Table A.2. List of components for the BC337 based NPN transistor module
     Table A.3. List of components for the TIP142 based NPN Darlington power transistor module
     Table A.4. List of components for the IRL540N based N-Channel power MOSFET module
     Table A.5. List of components for the 1-channel optical isolation module
     Table A.6. List of components for the 2-channel optical isolation module
     Table A.7. List of components for the H-bridge circuit with two relays
     Table A.8. List of components for the 0V to 5V Analog Input Module 1
     Table A.9. List of components for the 0V to 5V Analog Input Module 2
     Table A.10. List of components for the 0V to 5V Analog Input Module 3
     Table A.11. List of components for the 0V to 5V Analog Input Module 4
     Table A.12. List of components for the 0V to 5V Analog Input Module 5
     Table A.13. List of components for the 0-10V to 0-5V Signal Converter - Analog Input Module 1
     Table A.14. List of components for the 0-10V to 0-5V Signal Converter - Analog Input Module 2
     Table A.15. List of components for the 5V - +5V to 0-5V Signal Converter - Analog Input Module 1
     Table A.16. List of components for the 5V - +5V to 0-5V Signal Converter - Analog Input Module 2
     Table A.17. List of components for the 10V - +10V to 0-5V Signal Converter –
    Analog Input Module 1
     Table A.18. List of components for the 10V - +10V to 0-5V Signal Converter –
    Analog Input Module 2
     Table A.19. List of components for the 0-5V or 4-20mA to 0-5V Signal Converter - Analog Input Module 1
     Table A.20. List of components for the 0-5V or 4-20mA to 0-5V Signal Converter - Analog Input Module 2
     Table A.21. List of components for the 0V to 5V Analog Output Module
     Table A.22. List of components for the 0-5V to 0-10V Signal Converter – Analog
    Output Module
     Table A.23. List of components for the 0-5V to 5V - +5V Signal Converter - Analog
    Output Module 1
     Table A.24. List of components for the 0-5V to 5V - +5V Signal Converter - Analog
    Output Module 2
     Table A.25. List of components for the 0-5V to 10V - +10V Signal Converter -
    Analog Output Module 1
     Table A.26. List of components for the 0-5V to 10V - +10V Signal Converter -
    Analog Output Module 2
     Table A.27. List of components for the 0-5V to 4-20mA Signal Converter - Analog Output Module

    Biography

    Murat Uzam was borned in Söke, Turkey, in 1968. He received the B.Sc. and M.Sc. degrees from Electrical Engineering Department, Yıldız Technical University, İstanbul, Turkey, 1989 and 1991, respectively, and the Ph.D. degree from University of Salford, Salford, U.K., in 1998. He was with Nigde University, Turkey, from 1993 to 2010 in the Department of Electrical and Electronics Engineering as a Research Assistant, Assistant Professor, Associate Professor and Professor. He was a Professor in the Department of Electrical and Electronics Engineering, at Melikşah University in Kayseri, Turkey from 2011 to 2016. He was a Visiting Researcher with INRIA, University of Metz and University of Rennes, France, in 1999, with University of Toronto, Toronto, ON, Canada, in 2003, and with Xidian University, Xi’an, China, in 2013, 2015 and 2019. Since 15 April 2020, he has been serving as a Professor in the Department of Electrical and Electronics Engineering, at Yozgat Bozok University in Yozgat, Turkey. He has published 50 conference papers and 85 journal and magazine papers, 70 of which are indexed by Science Citation Index Expanded (SCIE). He has published two books in Turkish and one book in English by CRC Press (Taylor & Francis Group). According to Publons, his H-Index is 15 and his papers have been cited 1269 times by the papers indexed in the SCIE. His current research interests include design and implementation of discrete event control systems modeled by Petri nets and, in particular, deadlock prevention/liveness enforcing in flexible manufacturing systems, programmable logic controllers (PLCs), microcontrollers (especially PIC microcontrollers), and design of microcontroller-based PLCs. Dr. Uzam has been serving as a reviewer for prestigious journals and conferences. According to Publons, the number of his verified reviews is 70.