Truncated match.
PICList
Thread
'Can't change prescaler for TIMER2 on 16C74'
1995\12\26@090254
by
Edward Cheung
|
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.cheungTakeThisOuT
gsfc.nasa.gov | Statistics, Demos and Other Lies |
+---------------------------------------------------------------------------+
1995\12\26@092621
by
Edward Cheung
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.cheungKILLspam
@spam@gsfc.nasa.gov | Statistics, Demos and Other Lies |
+---------------------------------------------------------------------------+
1995\12\26@103225
by
Shel Michaels
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
|
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 <Sbmichaels
KILLspamAOL.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.cheungKILLspam
.....gsfc.nasa.gov | Statistics, Demos and Other Lies |
+---------------------------------------------------------------------------+
More... (looser matching)
- Last day of these posts
- In 1995
, 1996 only
- Today
- New search...