Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Programming delay in pic16f877a?

Status
Not open for further replies.

Hamza Kamran

Newbie level 1
Joined
Nov 2, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
8
I am currently stuck in a rut because I just started assembly and have no idea how to use it to program my microcontroller. I have to program a delay for the timers of 100ms. It would be great if someone would be able to help me out with the code because this is also the major part of my assignment. Help would be greatly appreciated.:sad:
 

Questions:

1. is your 16F877A using a crystal oscillator?
2. are you confident enough to use interrupts?

The crystal will be necessary if you want accurate timing. There are several ways to produce delays and each has good and bad points. The most 'universal' method is to use timers and interrupts but the code is more complicated. You can do it with delay loops which might be easier to understand but they effectively freeze the program until they are finished. If you are prepared to learn how timers and interrupts work, you will get best results in the end.

Brian.
 

Hi,

Are you using Mplab V8.92 or the newer MplabX ?

Have you Created a new project ?

Have you loaded the 'Template' file for the 16F877a from Mplabs Template folder?

This will get your project set up ready for your detailed code. picture below

However you need to make one change to that template code, the Config LVP should = OFF

There are many tutorials out here are a couple to look at.

http://www.winpicprog.co.uk/pic_tutorial.htm
**broken link removed** http://www.amqrp.org/elmer160/lessons/
 

Attachments

  • 000083.jpg
    000083.jpg
    83.8 KB · Views: 61

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top