Browse over 10,000 Electronics Projects using the Page Numbering provided at the bottom of each Page.

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

Single-Sided USB Charger
Single-Sided USB Charger
A FPGA controlled RGB LED MATRIX for Incredible Effects – the Hardware
A FPGA controlled RGB LED MATRIX for Incredible Effects – the Hardware
Using Nanotimers to Reduce IoT System Power Consumption by an Order of Magnitude
Using Nanotimers to Reduce IoT System Power Consumption by an Order of Magnitude
Replace a microwave’s beeping with the Windows XP startup sound
Replace a microwave’s beeping with the Windows XP startup sound
A DIY Laser Scanning Microscope
A DIY Laser Scanning Microscope
Reverse-engineering the surprisingly advanced ALU of the 8008 microprocessor
Reverse-engineering the surprisingly advanced ALU of the 8008 microprocessor
ESP8266 LED lighting: QuinLED v2.6 PCB
ESP8266 LED lighting: QuinLED v2.6 PCB
Switching LVDS Graphics in a Laptop Computer
Switching LVDS Graphics in a Laptop Computer
Teleknitting: TV-based string art
Teleknitting: TV-based string art
DIY Bubble Machine
DIY Bubble Machine
Start your day with Nerf target practice!
Start your day with Nerf target practice!
Teardown of a Peaktech 6225A
Teardown of a Peaktech 6225A

Top




Shares