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.

Pic up counter problem

Status
Not open for further replies.

Noman Yousaf

Full Member level 4
Full Member level 4
Joined
Nov 19, 2003
Messages
208
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Lahore Pakistan
Visit site
Activity points
1,763
Hi
I made very very simple 3 digit up counter with pic16f676.
but the problem is, when i run it on proteus 7.1, proteus says that
"simulator not running in real time because of excessive load on CPU"

where as i run the sample program even of calculator, it runs on 22 to 30% CPU load.
please anybody check the program and tell me the actual reason.

thanks in advance
 

Attachments

  • pic_counter.rar
    35.6 KB · Views: 48

Hi,

Tried your project and get the same 100% cpu usage and just a display of '000'

However the code is not written so others can easily follow it, there are very few comments to explain what the code is doing and this is complicated by the fact that the user registers are addressed in hex instead of labels, yet you also do use some labels such as DIG1.

If you want to learn assembly perhaps look at this good tutorial for guidance.

http://www.winpicprog.co.uk/pic_tutorial10.htm
 

Is this code you have written yourself or is it a disassembly of code produced by a compiler? The way it is written makes it look as though labels were added as an after-thought.

The warning is only that the simulator can't keep up with the program, it doesn't mean it wont work in a real chip. However, there are some constructs in the program that could be optimized to make it run faster.

Brian.
 

If you mix analogue and digital circuits in the same simulation, you get the problem of being unable to simulate in real time. replacing the transistors and resistors with a logic gates would help, but might not still be enough due to the current limiting resistors.
 

I am really very sorry to all. i couldnt write the comments.
actually i wanted to make a volt meter so all the code is written for that.
and it realy works. i checked it practiclay. then i tried to run it on protues then gave error, i described.
so i thought to run only an up counter. so i changed it to up counter but didnt delete the routines related to ADC.
This sode also works practically.
i m sending u the modified ASM file with comments. please check it and tell me my mistakes.

- - - Updated - - -

and one more very interesting fact. may be it is the error of protuse.
when i remove the connections of bases of transistors of common anode of display, displays still show "000". please check it too.

- - - Updated - - -

by the way i have used 8051 with keil, avr with avr studio. and in both IDEs, i can make hi or lo the ports of MCU in debuggers/ simulators but while using MPLAB (8.85) i couldnt. i worte very simple program to just turn on and off an LED by an input, when i run the simulator and changed the input, it didnt work. simply asking that in which way, i can make hi or lo the input of MCU in MPLAB?
 

Attachments

  • MG_PIC777.rar
    1.4 KB · Views: 45

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top