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

Vertical Pole Climbing Robot
Vertical Pole Climbing Robot
ESP8266 Weather Station Projects
ESP8266 Weather Station Projects
Single tube Lethal Nixie clock
Single tube Lethal Nixie clock
How to make a simple 1 watt audio amplifier (LM386 based)
How to make a simple 1 watt audio amplifier (LM386 based)
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Dot² isn’t your typical coffee table
Dot² isn’t your typical coffee table
Debugging ARM Cortex-M0+ HardFaults
Debugging ARM Cortex-M0+ HardFaults
EMP Jammer build
EMP Jammer build
A 3D-printed e-drum pad
A 3D-printed e-drum pad
Interactive geodesic LED dome = extreme geometric fun!
Interactive geodesic LED dome = extreme geometric fun!

Top




Shares