Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using PIC16F877 and HI-TECH C Compiler and I wish to include some delays in my code, but i do not know how to prescale the clock or how to set the iternal clock frequency of the PIC coz i wanna use the internal clock. I also dont know how to declare and use the PORTS and PORTS bits in C. I am new in the field of microcontrollers, please help!!!!!
Posted

Hi,

You are really on the wrong forum here. Microchip (who manufacture the chip) have their own forum which is actually quite good. Here's the link ....


[^]

You will need to refer to the data sheet for specific of how to setup the chip and the Hitech compiler help for information on what and how to call the relevent functions. (I don't use Hitech so I cannot help you there).

There are not many embedded programmers here anymore.

Best of Luck, :)

[edit]FTFY! But there are still a few of us kicking about. :laugh: [/edit]
[edit](I didn't know you were one too! :laugh: Ali)[/edit]
[edit](Yup. Started with embedded Z80 straight out of Uni, and moved up, down and sideways through HD64180/Z180 "Z80 with knobs on", SGS, PICs, and ARM, depending on need and hardware designer.)[/edit]
[edit](Us 6502 developers were really jealous of your Z80 with its 16 bit registers! :mad: .... :-D )[/edit]
[edit]Oh yes - and fully vectored interrupts, a movable stack pointer, alternate register set for fast interrupt processing! Still only a 64K address range though... :sigh: When I think what we did in 32K ROM & 32K RAM it amazes me sometimes :-D [/edit]
[edit]Show off! ;P [/edit]
 
Share this answer
 
v7
Why are you using a 877? It is listed as "Not Recommended For New Design" on the PIC website, which means that they are likely to stop manufacturing it in the near future, if they haven't already. Certainly, it is no longer listed as "in production", and I would be very nervous about the longevity of any product based on such a component. They suggest using the 887 instead.[^]

Additionally, do you really need to change the clock frequency? Wouldn't it be better to use the internal timers instead?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900