PDA

View Full Version : Xtal for 16f84a-16f628a



savnik
- 13th August 2007, 08:29
I have wrote a programm for 16f84a and 16f628a with crystal 4MHZ.
If i change the crystal to 20Mhz and define 4 to define 20 , will that works;

Acetronics2
- 13th August 2007, 10:00
Hi, Savnik

Depends on what your program is supposed to do and how it is written ... my Crystal ball is out for repairs !!!

Timing instructions ( PULSIN, RCTIME,COUNT,FREQUOUT, etc ...) will especially be modified ... as stated in the PbP Manual ... if you've spread some assembler, or use interrupts, may be some registers preloadings ( TMRs i.e.) will have to be modified ...

No more details available without knowing what you've written ...

Alain

savnik
- 13th August 2007, 12:26
Hi, Savnik

Depends on what your program is supposed to do and how it is written ... my Crystal ball is out for repairs !!!

Timing instructions ( PULSIN, RCTIME,COUNT,FREQUOUT, etc ...) will especially be modified ... as stated in the PbP Manual ... if you've spread some assembler, or use interrupts, may be some registers preloadings ( TMRs i.e.) will have to be modified ...

No more details available without knowing what you've written ...

Alain
If i want to turn on and off one led;

Acetronics2
- 13th August 2007, 12:38
If i want to turn on and off one led;

If you JUST want to turn the led ON or OFF ... no mod. involved.

Note with the DEFINE OSC 20 ... PAUSE and PAUSEUS will still give the "written" time.

Alain

savnik
- 13th August 2007, 14:08
If you JUST want to turn the led ON or OFF ... no mod. involved.

Note with the DEFINE OSC 20 ... PAUSE and PAUSEUS will still give the "written" time.

Alain
I don't want to change the code.I ask because i have one pic16f84a-04 and one pic16f628a

Darrel Taylor
- 13th August 2007, 15:16
For 20Mhz, you'll also need to change the oscillator config to HS.
<br>

savnik
- 13th August 2007, 20:06
For 20Mhz, you'll also need to change the oscillator config to HS.
<br>
I know , but the pic16f84a-04 and pic16f628a work with crystal 20 Mhz;

mvs_sarma
- 14th August 2007, 19:23
I don't want to change the code.I ask because i have one pic16f84a-04 and one pic16f628a

please go thro the datasheet Ds35007B in respect of PIC16F84A-4/20-- figures 9-1 and 9-2 and relevent comments. it is however possible as per the datasheet but voltage restrictions apply , i beleive.

for PIC16F628A, it is possible to have any crystal.

In both cases appropriate config commet to be moddedas you know already

savnik
- 14th August 2007, 20:05
please go thro the datasheet Ds35007B in respect of PIC16F84A-4/20-- figures 9-1 and 9-2 and relevent comments. it is however possible as per the datasheet but voltage restrictions apply , i beleive.

for PIC16F628A, it is possible to have any crystal.

In both cases appropriate config commet to be moddedas you know already
Thank you.