Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

In-circuit debugging using PIC16F877

In-circuit debugging using PIC16F877

This is a simple program that can be merged with other sources to allow easy in-circuit debugging.
When you’re writing a program for a normal computer and it isn’t quite doing what you want it to do you simply print some variables to the screen to see what’s going on. Since microcontrollers don’t have a screen these debugging variables will have to be printed on the screen of the PC.

As a test I used the following schematic. It features two analog inputs on port A, a0 and a4, both equipped with a 10k LIN variable resistor. On port B b1 is a digital input with a 10k pull down resistor, and port C c4 has a digital output with a LED attached to it.

The test program uses all the inputs and outputs (otherwise it would have been rather useless to built the entire schematic, wouldn’t it), and it has an internal counter. This counter is incremented at each loop and will light the LED as soon as the counter exceeds 100. Since the variables restart at 0 after 255 is reached the LED will actually flash.

Visit Here for more.







 

More Articles to Read

An Arduino-controlled automated whiskey distillery
An Arduino-controlled automated whiskey distillery
The Rex800 looks like a dinosaur Terminator
The Rex800 looks like a dinosaur Terminator
Home Environment Monitor
Home Environment Monitor
Understanding the Operation of the Frequency Synthesizer in Maxim’s RF Transceivers
Understanding the Operation of the Frequency Synthesizer in Maxim’s RF Transceivers
App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: Noise analysis for high-speed op amps
App note: Noise analysis for high-speed op amps
Skill Sunday: Arrays
Skill Sunday: Arrays
App note: Infrared remote control implementation with MSP430FR4xx
App note: Infrared remote control implementation with MSP430FR4xx
Gesture Controlled Smart Home
Gesture Controlled Smart Home
Design for a Wideband, Differential Transimpedance DAC Output
Design for a Wideband, Differential Transimpedance DAC Output
Wrist thrusters let you fly through the water effortlessly
Wrist thrusters let you fly through the water effortlessly
Bertan/Spellman 225-20R HV power supply teardown
Bertan/Spellman 225-20R HV power supply teardown
Blinking Christmas Lights
Blinking Christmas Lights
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adding an “extra sense” with rangefinders
Adding an “extra sense” with rangefinders
This wireless game controller looks like a rug
This wireless game controller looks like a rug
How to run your ESP8266 for years on a battery
How to run your ESP8266 for years on a battery
Calibration of a 3-Phase Energy Meter Board on the ADE7754
Calibration of a 3-Phase Energy Meter Board on the ADE7754
Making beats on a tiny Arduino DJ controller
Making beats on a tiny Arduino DJ controller
Qinsi-QS5100 Sn63Pb37 solder profile
Qinsi-QS5100 Sn63Pb37 solder profile

Top


Shares