Truncated match.
PICList
Thread
'TMR1 still no luck!'
1996\05\16@145533
by
Xaq
|
I am ready to pull my hair out! I can not figure out what is wrong. It
should be real simple and I am sure I missing something real stupid. When I
run the following code, all I get is the one test beep. I hate to post code
and say "Here, fix it", but I don't know what else to try. And sorry to
those MPASM users, I use the parallax assembler.
DEVICE PIC16C74,HS_OSC,WDT_OFF,PROTECT_OFF
org 00h ; start vector
goto Start
org 04h ; interrupt vector
goto ServiceInterrupts
; there are a bunch of variable definitions here
; (I din't think you needed to see those)
Start
call ClearRam ; clear all ram
call InitPorts ; initialize ports
call beep ; beep for half a second, a test beep
clrf PIR1
mov INTCON,#11000000b
mov T1CON, #00100001b
mov PIE1, #00000001b
mov TMR1H, #11111111b
mov TMR1L, #00000000b ;set to interrupt after 256*4 inst cycles
:loop goto :loop ; wait for int
ServiceInterrupts
call wait ;adds delay so that you can hear the two beeps
call beep
clrb TMR1IF ;clear interrupt flag
retfie
; the other routines are down here, such as ClearRam,Beep ...
; I am sure those routines work.
Thanks
Zach
1996\05\16@151200
by
Adrian Clinciu
>
>
> DEVICE PIC16C74,HS_OSC,WDT_OFF,PROTECT_OFF
> org 00h ; start vector
> goto Start
> org 04h ; interrupt vector
> goto ServiceInterrupts
>
>
> ; there are a bunch of variable definitions here
> ; (I din't think you needed to see those)
>
>
>Start
>
> call ClearRam ; clear all ram
> call InitPorts ; initialize ports
> call beep ; beep for half a second, a test beep
> clrf PIR1
> mov INTCON,#11000000b
--------------------------^
This is EEPROM interrupt enable bit. Try to set bit 5.
Enjoy!
1996\05\16@175812
by
Jim Main
At 12:00 PM 16/05/96 GMT, you wrote:
beep
> clrf PIR1
> mov INTCON,#11000000b
> mov T1CON, #00100001b
> mov PIE1, #00000001b
> mov TMR1H, #11111111b
> mov TMR1L, #00000000b ;set to interrupt after 256*4 inst cycles
>:loop goto :loop ; wait for int
You forgot to set STATUS,RP0 for PIE1 register - it's in register bank 1 !!
eg.
bsf STATUS,RP0
movlw b'00000001'
movwf PIE1
bcf STATUS,RP0
More... (looser matching)
- Last day of these posts
- In 1996
, 1997 only
- Today
- New search...