Searching \ for 'Can't change prescaler for TIMER2 on 16C74' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ints.htm?key=prescale
Search entire site for: 'Can't change prescaler for TIMER2 on 16C74'.

Truncated match.
PICList Thread
'Can't change prescaler for TIMER2 on 16C74'
1995\12\26@090254 by Edward Cheung

flavicon
face
I am using the PWM module on the '74, and have been succesful in getting
an output from the CCP1 module.  I can vary the duty cycle with no problem.

The problem is that the PWM frequency is too low.  I am using a 19.6608 Mhx
crystal, and the PWM frequency results in 1.2 kHz.  From all indications,
the prescaler is set to 1:16, and I need a ratio of 1:1.  I tried changing
the prescaler by flipping the bits in T2CON, but nothing happens.  Here is
my init code :

 MOVLW       H'04'          ;Timer 2 on, prescaler = 1
 MOVWF       T2CON
 MOVLW       B'00001100'    ;PWM ON
 MOVWF       CCP1CON
 MOVLW       H'FF'          ;PR2 = OXFF
 MOVWF       H'80'^PR2

The databook says that T2CON controls the prescaler, but it does not work.
I have tried with three '74 so far.  Have I done something wrong or is there
a bug?

My machine will be done for service starting on 12/27, please reply soon.

Many, many thanks!

+---------------------------------------------------------------------------+
|          Edward Cheung, Ph.D.         |  The opinions expressed herein    |
|    NASA Goddard Space Flight Center   |    do not necessarily reflect     |
|           Mail Code  J&T/442          |       those of my employers'      |
|          Greenbelt, MD 20771          |                                   |
|   301-286-1269(office) 286-1717(fax)  |  My next book:                    |
| Internet: spam_OUTedward.cheungTakeThisOuTspamgsfc.nasa.gov | Statistics, Demos and Other Lies  |
+---------------------------------------------------------------------------+

1995\12\26@092621 by Edward Cheung

flavicon
face
In a previous message I wrote:
>My machine will be done for service starting on 12/27, please reply soon.

I meant to say:
My machine will be down for service starting on 12/27
                  ^^^^

Thanks

+---------------------------------------------------------------------------+
|          Edward Cheung, Ph.D.         |  The opinions expressed herein    |
|    NASA Goddard Space Flight Center   |    do not necessarily reflect     |
|           Mail Code  J&T/442          |       those of my employers'      |
|          Greenbelt, MD 20771          |                                   |
|   301-286-1269(office) 286-1717(fax)  |  My next book:                    |
| Internet: .....edward.cheungKILLspamspam@spam@gsfc.nasa.gov | Statistics, Demos and Other Lies  |
+---------------------------------------------------------------------------+

1995\12\26@103225 by Shel Michaels

picon face
In a message dated 95-12-26 09:03:16 EST, you write:

>  Here is
>my init code :
>
>  MOVLW       H'04'          ;Timer 2 on, prescaler = 1
>  MOVWF       T2CON
>  MOVLW       B'00001100'    ;PWM ON
>  MOVWF       CCP1CON
>  MOVLW       H'FF'          ;PR2 = OXFF
>  MOVWF       H'80'^PR2

Presumably in actuality you set RP0 before you store in RP2, which is in bank
1?

...Shel Michaels

1995\12\26@111033 by Edward Cheung

flavicon
face
From me:
>  MOVLW       H'04'          ;Timer 2 on, prescaler = 1
>  MOVWF       T2CON
>  MOVLW       H'FF'          ;PR2 = OXFF
>  MOVWF       H'80'^PR2

From the wise one: Shel Michaels <SbmichaelsspamKILLspamAOL.COM>
>Presumably in actuality you set RP0 before you store in RP2, which is in bank
>1?

ARRGGHHH!!  You are right!  By not setting the page bit, the above
operation stores 0xFF into T2CON, erasing the 0x04 I put in earlier.
I suppressed the warning by using the ^0x80, but forgot to set the page
bit.  Many thanks!

+---------------------------------------------------------------------------+
|          Edward Cheung, Ph.D.         |  The opinions expressed herein    |
|    NASA Goddard Space Flight Center   |    do not necessarily reflect     |
|           Mail Code  J&T/442          |       those of my employers'      |
|          Greenbelt, MD 20771          |                                   |
|   301-286-1269(office) 286-1717(fax)  |  My next book:                    |
| Internet: .....edward.cheungKILLspamspam.....gsfc.nasa.gov | Statistics, Demos and Other Lies  |
+---------------------------------------------------------------------------+

More... (looser matching)
- Last day of these posts
- In 1995 , 1996 only
- Today
- New search...