Duvida Timer 1 - Externo

Software e Hardware para uC PIC

Moderadores: andre_luis, 51, guest2003, Renie

Duvida Timer 1 - Externo

Mensagempor lasfclestat » 09 Mar 2009 15:39

Boa Tarde

Estou utilizando o PIC16F628A e estou tentando fazer o incremento do Timer 1 externamente.
O T1CON esta dessa forma, T1CON = 0b00110111, Pois eu estou fazendo o incremento no pino T1CKI, porém não está funcionando corretamente.

Eu estou gerando uma onda quadrada variando entre 100 a 1000 Hz porém em alguns casos isolados funcionou.

T1CON
U U R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON

bit 7-6 Unimplemented: Read as ‘0’

bit 5-4 T1CKPS<1:0>: Timer1 Input Clock Prescale Select bits
11 = 1:8 Prescale value
10 = 1:4 Prescale value
01 = 1:2 Prescale value
00 = 1:1 Prescale value

bit 3 T1OSCEN: Timer1 Oscillator Enable Control bit
1 = Oscillator is enabled
0 = Oscillator is shut off(1)

bit 2 T1SYNC: Timer1 External Clock Input Synchronization Control bit
TMR1CS = 1
1 = Do not synchronize external clock input
0 = Synchronize external clock input

TMR1CS = 0
This bit is ignored. Timer1 uses the internal clock when TMR1CS = 0.
bit 1 TMR1CS: Timer1 Clock Source Select bit
1 = External clock from pin RB6/T1OSO/T1CKI/PGC (on the rising edge)
0 = Internal clock (FOSC/4)

bit 0 TMR1ON: Timer1 On bit
1 = Enables Timer1
0 = Stops Timer1

Se alguem puder dar alguma dica de como eu posso resolver isso au agradeço.

[]s
"Se existe algo como repousar em nome da verdade. Então vós e teus amados, qualquer que sejam as dificuldades, não devem ficar separados indefinidamente!"

Ferrari Caim Lestat
lasfclestat
Bit
 
Mensagens: 47
Registrado em: 29 Jan 2008 15:48
Localização: Campinas

Mensagempor lasfclestat » 09 Mar 2009 16:12

Achei o Problema...

O valor que eu estava colocando em TMR1H e TMR1L estava muita pequeno, e estava demorando muito tempo para estourar o timer 1.


OBrigado.
"Se existe algo como repousar em nome da verdade. Então vós e teus amados, qualquer que sejam as dificuldades, não devem ficar separados indefinidamente!"

Ferrari Caim Lestat
lasfclestat
Bit
 
Mensagens: 47
Registrado em: 29 Jan 2008 15:48
Localização: Campinas


Voltar para PIC

Quem está online

Usuários navegando neste fórum: Google [Bot] e 1 visitante

x