barcode reader application in asp.net Debug: An Application to Test Your Debug Skills in Software

Generator Denso QR Bar Code in Software Debug: An Application to Test Your Debug Skills

Debug: An Application to Test Your Debug Skills
Scan Quick Response Code In None
Using Barcode Control SDK for Software Control to generate, create, read, scan barcode image in Software applications.
Draw Quick Response Code In None
Using Barcode encoder for Software Control to generate, create QR Code ISO/IEC18004 image in Software applications.
After working through some experiments and applications on your own, I m sure that you will experience a few problems along the way with developing your application program incorrectly or building a circuit wrong. I m also pretty sure that you will spend a lot of time backtracking, trying to gure out what the actual problem was. To end this chapter, I want to give you a bit of a test using the application circuit shown in Fig. 14.2
QR-Code Decoder In None
Using Barcode scanner for Software Control to read, scan read, scan image in Software applications.
QR Code Encoder In Visual C#
Using Barcode printer for .NET Control to generate, create QR Code JIS X 0510 image in .NET framework applications.
Vcc 16F84 0.1 uF Gnd Vcc 10 K
Quick Response Code Creation In Visual Studio .NET
Using Barcode maker for ASP.NET Control to generate, create QR Code image in ASP.NET applications.
Creating Denso QR Bar Code In .NET Framework
Using Barcode printer for Visual Studio .NET Control to generate, create QR Code ISO/IEC18004 image in Visual Studio .NET applications.
4 _MCLR 16 Osc 1 15 Osc 2 5 V
QR-Code Creation In VB.NET
Using Barcode encoder for .NET Control to generate, create QR Code JIS X 0510 image in .NET framework applications.
Encode UPC-A Supplement 5 In None
Using Barcode encoder for Software Control to generate, create GS1 - 12 image in Software applications.
Vdd RA0
Barcode Creation In None
Using Barcode generation for Software Control to generate, create barcode image in Software applications.
Code 128 Code Set A Maker In None
Using Barcode printer for Software Control to generate, create Code 128 Code Set A image in Software applications.
Momentary On 10 K Momentary 220 On
Generate Data Matrix 2d Barcode In None
Using Barcode creator for Software Control to generate, create ECC200 image in Software applications.
Printing Code 3/9 In None
Using Barcode creator for Software Control to generate, create Code 39 image in Software applications.
RB0 RB1
Encode Identcode In None
Using Barcode drawer for Software Control to generate, create Identcode image in Software applications.
Paint Code 128B In Visual C#
Using Barcode drawer for Visual Studio .NET Control to generate, create Code 128 image in .NET applications.
4 MHz
Read Code-128 In Visual Studio .NET
Using Barcode scanner for .NET framework Control to read, scan read, scan image in .NET framework applications.
Bar Code Generator In Objective-C
Using Barcode generator for iPhone Control to generate, create bar code image in iPhone applications.
Gnd Gnd
Code-39 Encoder In Java
Using Barcode encoder for Android Control to generate, create ANSI/AIM Code 39 image in Android applications.
Encoding Bar Code In VB.NET
Using Barcode maker for Visual Studio .NET Control to generate, create bar code image in VS .NET applications.
Figure 14.2 Debug circuit turn on LED1 on power up LED2 when button is pressed.
Print Code 128 Code Set A In Objective-C
Using Barcode generator for iPad Control to generate, create ANSI/AIM Code 128 image in iPad applications.
Painting Bar Code In Visual Studio .NET
Using Barcode encoder for ASP.NET Control to generate, create barcode image in ASP.NET applications.
DEBUGGING YOUR APPLICATIONS
TABLE 14.2 PART
BILL OF MATERIALS FOR DEBUG CIRCUIT DESCRIPTION
PIC16F84 0.1- F decoupling capacitor 4-MHz ceramic resonator RA0 pull-up RA0 switch RB0, RB1 LED RB0, RB1 LED resistor Vcc
PIC16F84-04/P 0.1- F Vdd/Vss decoupling capacitor 4-MHz ceramic resonator with built-in capacitors 10 k , 1/4 W Momentary on Red LED 220 , 1/4 W
5-V power supply (4 AA NiMH rechargeable batteries or 3 AA alkaline batteries)
(with a bill of materials listed in Table 14.2) to see how ef cient you are at nding problems and xing them. For this experiment, I would like you to build the circuit shown in Fig. 14.2 and build it using the breadboard layout shown in Fig. 14.3. Once the circuit is built, load your PIC16F84 with debug.asm:
Vcc Gnd
+5 Volt P/S 10 K
LED Switch Button
10 K
Breadboard circuit for debug circuit application.
0.1 uF
PIC16F84
4 MHz
DEBUG: AN APPLICATION TO TEST YOUR DEBUG SKILLS
title debug - An application with a few problems ; ; This is an application to demonstrate how insidious some ; problems ; can be. This application should be burned into a ; PIC microcontroller after ; assembly to see if the problems built into it can be ; found. ; ; The application is *supposed* to turn on a LED at RB1 ; and wait for ; a button to be pressed. When it is, an LED at RB0 ; should be turned on as well. ; ; Hardware Notes: ; PIC16F84 running at 4 MHz ; _MCLR is tied through a 4.7K Resistor to Vcc and PWRT ; is Enabled ; A 220 Ohm Resistor and LED is attached to ; PORTB.0/PORTB.1 and Vcc ; A 10K pull up is connected to RA0 with a Momentary on ; Switen ; ; Myke Predko ; 99.12.07 ; LIST R=DEC ifdef __16F84 INCLUDE p16f84.inc else ifdef __16F877 INCLUDE p16f877.inc endif ; Registers
ifdef __16F84 __CONFIG _CP_OFF & _WDT_ON & _XT_OSC & _PWRTE_ON else __CONFIG _CP_OFF & _WDT_ON & _XT_OSC & _PWRTE_ON & _DEBUG_OFF & _LVP_OFF & _BODEN_OFF endif PAGE Mainline of debug 0
DEBUGGING YOUR APPLICATIONS
nop movlw movwf bsf movlw movwf bcf Loop btfsc goto clrf 0x001 PORTB STATUS, RP0 0x0FC TRISB ^ 0x090 STATUS, RP0 ; LED at RB1 is On/RB0 is Off
; Goto Bank 1 to set Port Direction ; Set RB0/RB1 to Output ; Go back to Bank 0
PORTA, 0 Loop PORTA
Wait for RA0 Button to be Pressed
; ; ;
Set RB0 = RB1 = 0 for Both LEDs on Loop Forever
goto
Loop
This application is designed to turn on a LED at RB1 and wait for the button at RA0 to be pressed (pulled down low). When the button is pressed, the LED at RB0 will be turned along with the button at RB1. Without simulating this application, after you have built it and put in a programmed PIC16F84, I would like you to try to get the application to execute properly. If you have read through the proceeding chapters and worked through all the experiments, you should be able to get this application running without too many problems. So that you don t cheat, I ve asked that this book be laid out in such a way that you can t see my comments on nding the problems on the following pages. When you think you have found all the problems, turn the page to see what the problems are that I put in the code and how I think you should have approached nding them.
This page intentionally left blank
DEBUGGING YOUR APPLICATIONS
How did you do You should have found two wiring errors, three de nite errors with the source code, and one questionable instruction. The problems are very representative of what you will see both in your own applications and in designs you pick up from other people. The biggest question you should be asking yourself is: How ef cient was I at nding the problems I would expect someone very experienced with PIC microcontroller to nd them all within about 5 minutes. If you spent an hour or more trying to nd all the problems, don t feel bad about it. Finding and eliminating problems is one of the biggest skills that you will have to learn for working not only with the PIC microcontroller but also with software that you write and applications that you build. After building the circuit as shown in Fig. 14.2, when you apply power to the circuit, neither LED will turn on. The rst thing that you should check is
Copyright © OnBarcode.com . All rights reserved.