Programming the Finite State Machine

  • FabrikantElektor Publishing

Omschrijving

Programming the Finite State Machine with 8-Bit PICs in Assembly and C

Andrew Pratt provides a detailed introduction to programming PIC microcontrollers, as well as a thorough overview of the Finite State Machine (FSM) approach to programming. Most of the book uses assembly programming, but do not be deterred. The FSM gives a structure to a program, making it easy to plan, write, and modify. The last two chapters introduce programming in C, so you can make a direct comparison between the two techniques. The book references the relevant parts of the Microchip datasheet as familiarity with it is the best way to discover detailed information.

This book is aimed at Microsoft Windows and Linux users. To keep your costs to a minimum and to simplify the toolchain, specific applications are provided as a free download to enable you to use an FTDI serial lead as the programmer. The assembler used is the open-source "gpasm". All programming can be done in a text editor. There are detailed instructions on how to perform the necessary installations on Windows, Linux Debian, and derivatives such as Ubuntu and Fedora. For programming in C, Microchip's XC8 compiler is used from the command line. In addition to the programming applications, two serial read and serial write applications can be used for communicating with the PICs from a computer.

A voltmeter project including practical instructions on building a circuit board from scratch is included. All theory is covered beforehand, including how to do integer arithmetic in assembly.

Two PICs are covered: the PIC12F1822 and the PIC16F1823. Both can run at 32 MHz with an internal oscillator. You do not need to buy a factory-made development board and programmer. With relatively inexpensive parts including a serial lead, microcontroller, a few resistors, and LEDs, you can get started exploring embedded programming.

Links


Productformulier

Programming the Finite State Machine with 8-Bit PICs in Assembly and C Andrew Pratt provides a detailed introduction to programming PIC... Lees meer

€ 32,95 incl. BTW
Leden € 29,66

      Details

      SKU: 19327
      EAN: 9781907920929
      ISBN: 978-1-907920-92-9
      Auteur: Andrew Pratt
      Taal: English
      Pagina's: 188
      Formaat: 17 x 23.5 cm (Paperback)

      Omschrijving

      Programming the Finite State Machine with 8-Bit PICs in Assembly and C

      Andrew Pratt provides a detailed introduction to programming PIC microcontrollers, as well as a thorough overview of the Finite State Machine (FSM) approach to programming. Most of the book uses assembly programming, but do not be deterred. The FSM gives a structure to a program, making it easy to plan, write, and modify. The last two chapters introduce programming in C, so you can make a direct comparison between the two techniques. The book references the relevant parts of the Microchip datasheet as familiarity with it is the best way to discover detailed information.

      This book is aimed at Microsoft Windows and Linux users. To keep your costs to a minimum and to simplify the toolchain, specific applications are provided as a free download to enable you to use an FTDI serial lead as the programmer. The assembler used is the open-source "gpasm". All programming can be done in a text editor. There are detailed instructions on how to perform the necessary installations on Windows, Linux Debian, and derivatives such as Ubuntu and Fedora. For programming in C, Microchip's XC8 compiler is used from the command line. In addition to the programming applications, two serial read and serial write applications can be used for communicating with the PICs from a computer.

      A voltmeter project including practical instructions on building a circuit board from scratch is included. All theory is covered beforehand, including how to do integer arithmetic in assembly.

      Two PICs are covered: the PIC12F1822 and the PIC16F1823. Both can run at 32 MHz with an internal oscillator. You do not need to buy a factory-made development board and programmer. With relatively inexpensive parts including a serial lead, microcontroller, a few resistors, and LEDs, you can get started exploring embedded programming.

      Links


      Customer Reviews

      Based on 2 reviews
      50%
      (1)
      50%
      (1)
      0%
      (0)
      0%
      (0)
      0%
      (0)
      J
      Jonathan
      FSM

      The data sheet for the 12F1822 chip runs to over 400 pages. These PDFs are only really useful for someone who already knows quite a bit about how to handle and program these devices. If you want to learn you need a guide - and in my experience preferably more than one guide. I think this book is an example of a great guide. Reading through, learning by following the code and trying out the programs has really helped me. I thoroughly recommend Andrew Pratt`s interesting and useful book.

      R
      Ronald B.
      Een leuk boek om door te werken

      Het boek Programming the finite state machines is een leuk boek om door te werken en geeft een uitstekende uitleg.
      In het boek worden de Microchips PIC 12F1822 en 16F1823 gebruikt waar ik even naar moest zoeken (bij elektor kon ik ze niet vinden).
      Uiteindelijk heb ik ze bij de firma : www.voti.nl gevonden (heeft een wat oudere website) tevens wordt in het boek naar een kabel verwezen waarvan elektor de 3v3 uitvoering heeft maar je hebt de 5v uitvoering nodig (is enkel in het buitenland te krijgen)
      Daarom heb ik bij voti de Wisp648 besteld en de XWisp software gedownload waarmee je vele PIC`s kan programmeren en dit werkte uitstekend.
      Het enige nadeel was dat ik zelf even een serial_writer.c en serial_reader.c programma moest schrijven voor de RasPi om diverse hoofdstukken door te werken (uitgelezen via cp210x met extra 5v pin en/of serial port op RasPi. Let op benodigde spanning deling : Pic(tx5v)--1k--RasPi(rx3v3)--2.2k---gnd ).
      Helaas kon ik deze programmatjes niet in deze review er bij plakken (was geen knop voor).

      De volgende kleine foutjes en/of verbeteringen voor de uniformiteit kwam ik tegen in het boek :
      blz 45 GOTO M1_S2 : The jump .... if W = 1 moet GOTO M1_S2 : The jump .... if W = 2 zijn
      blz 49 verwijder #INCLUDE wordt pas vanaf hoofdstuk 3 gebruikt en voegt niets toe in het programma prog_02_03.asm
      blz 154 TRISAbits.TRISA2 vervangen door TRISA2 en PORTAbits.RA2 vervangen door RA2 de compiler geeft hier geen fout maar staat niet in documentatie compiler
      Blz 160 verwijder pulse_counter_slow en pulse_counter_fast geeft geen fout maar worden niet gebruikt in het programma
      Blz 163 vervang else if (tick_couter < 122*12) door else if ((tick_counter >=122*8) && (tick_couter < 122*12)) progr_09_04
      blz 164 INTCONbits.TMR0IF = 0 vervang door TMR0IF = 0 en TRISAbits.TRISA4 = 0 door TRISA4 = 0 beide werken maar het voorloop gedeelte staat niet in documentatie compiler en wordt eigenlijk niet in boek gebruikt
      blz 167 Oplossing is natuurlijk dat bij de initalisatie van het programma LATA4 = 0 is bij anode display en moet 1 zijn om het streepje in het midden van de 8 weg te halen
      blz 170 count++ en read = counter%s worden niet gebruikt prog_09_08 dus kunnen ook gewoon verwijderd worden.

      Login

      Wachtwoord vergeten?

      Heb je nog geen account?
      Maak account aan