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.

Timer using PIC16C55 - HELP!!!

Status
Not open for further replies.

slinky

Newbie level 1
Joined
Jan 9, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
pic16c55 assembler

First of all, hello to all and HAPPY NEW YEAR!
Now, i've designed a circuit including the above microcontroller and i've "run" the assembly code in a simulator called MPLAB IDE.Unfortunately, i've never managed to see it working properly.Note tha it contains no errors and it must be correct.Running it in the simulator i can't see the counting from 0-15 secs, since the algorithm demands the button START to be pushed in order to start the timer.I can't do such a thing during the simulation!Someone could say:"OK then.Just programme it once and if it doesn't work then make some changes.".Well such a thing can't be done, since the PIC16C55 is an one-time-programmable chip!Once the assembly code is wrong, the chip becomes useless!What should i do?Any website that might help?
And the worst of all is that i must have completed this project by Thursday!It's an S-O-S situation!Thank u all in advance.
Any advice is welcome!

PS:Anyone who wants to check my assembly code just say it!
 

pic16c55 asm

Hello,
Your application is relatively simple. Try to follow this guide:

1.) Connect your switch to RB0. Your switch will give the interrupt to signal your PIC to start counting.

Running it in the simulator i can't see the counting from 0-15 secs,

2.) I don't know what do you mean by this. What do you want to count? What do you want the PIC should do?

3.) If your applciation does involve real time dimension such as real time clock, seconds counting, refreshing etc.., it is highly advisable to use the Timers TMR0, TMR1 etc. i don't know if the PIC you are using contains TMR0 or TMR1.

4.) If your application is not for mass production, you could opt to Flash PICs instead to give you flexibility in case something goes wrong. remember Moore's Law, "If something can go wrong, it will go wrong". You can use PIC16F84 a simple choice choice with a TMR0

Hope this helps.
 

pic16c55 project

You CAN simulate pushing the button in MPLAB IDE.

First, select the simulator: Debugger..Select tool.. MPLAB SIM

Then click Debugger.. Stimulus controller..New scenario.
A window will pop up. Click on the Pin/SFR header and from the dropdown box select the pin you want. Click on the Action header and select the type of input you want. I usually use Toggle, because I control it manually, without having to think too much about duration. But if the application requires pulses of a certain width, you can select those, too. And you can also set the pin to LOW or HIGH.

Continue with other pins.

Then, whenever you need to apply the pin stimulus, just click on the > sign at the left, to fire the stimulus. For a toggle, the pin state will change. You can then step through your program and see if it performs as expected.

You can then save the scenario, for use in another project. However, it it not absolutely necessary, and if you save the workspace before closing the project, then those settings will be preserved, so next time you work they will be there.

I hope this helps.
VVV
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top