⚡ Descuentos en cursos en video - Lleva tu aprendizaje técnico al siguiente nivel y aprovecha precios especiales antes de que termine la oferta. 🔥 Aprovechar oferta ahora 🔥
Microcontrollers and digital systems

Problem with PIC microcotrolator

Jorge2017
hace 5 años
hace 5 años
Hello good afternoon friends, I tell you that I am new to learning microcontrollers, now I am trying to use timer 1, using the overflow interrupt in PIC 12F629, the program what I would have to do is for about half a second to turn on a LED and another half second to turn it off and so on, I don't know if I am making a mistake in the configuration or I need to add something to the interrupt service subroutine, of course thanks for your help, the program is following: prueba04.asm [986] I copy it and paste it below: ; test_04 = It is about using, configuring and implementing timer 1 ; of PIC 12F629 causing an LED to light around medium ; second and turn off about half a second successively. LIST P = 12F629 INCLUDE <P12F629.INC> __CONFIG _CP_OFF & _CPD_OFF & _WDT_OFF & _BOREN_OFF & _MCLRE_ON & _PWRTE_ON & _INTRC_OSC_NOCLKOUT #DEFINE LED GPIO, GP0 ORG 0 goto Home ORG 4 goto Interrupcion_TMR1 Start bsf STATUS, RP0 clrf TRISIO call 03FFh movwf OSCCAL movlw b'00000001 ' movwf FOOT1 bcf STATUS, RP0 movlw b'00000000 ' movwf TMR1L movwf TMR1H movlw b'00110101 ' movwf T1CON movlw b'11000000 ' movwf INTCON Principal Main goto TM_1 interruption movlw b'00000000 ' movwf TMR1L movwf TMR1H btfsc LED goto is on bsf LED goto FinInterrupcion Its on bcf LED End Interrupt bcf PIR1, TMR1IF retfie ORG 03FFh retlw b'10000000 ' END
first
first
236
hace 5 años

I'm quite rusty with the issue of asm but I think this line is as meaningless
> Main <
> Main goto <
It's like it's an infinite loop

Responder
Jorge2017
hace 5 años

hello first, if it is an infinite loop but it should be broken by the interruption and understand the interruption subroutine, I will see what happens if I put something else such as "$" instead of "Main"

Responder
Jorge2017
hace 5 años

Thank you very much first, I went to the forum and saw that they were talking about PIC 12F629, the initial question was something similar to what I want to do, but he does it using delay subroutines, I want to do it using Timer1, using its overflow interruption, That's why I don't know if it is badly configured or that in my prigramita the Timer 1.

Responder
Jorge2017
hace 5 años

Hello people, after simulating the program in MPLAB, I realized that I needed to turn off the comparator. Thank you very much first, if I remember correctly they made a comment about that in the forum you passed me but I ignored it. Now it works correctly.

Responder
first
first
236
hace 5 años

ok I'm glad, the hundred if I could not solve the first, but it is a long time since I programmed pic and much less in asm

Responder
Jorge2017
hace 5 años

How do I solve this question?

Responder
first
first
236
hace 5 años

Well, no idea, you should get a button out there with the option

Responder
Jorge2017
hace 5 años
hace 5 años
The analog comparator had to be turned off.
Reparaciones similares solucionadas

¿Conoces una solución?

¡Aprende a reparar con estos cursos YoReparo!

4.84
(25)

Curso Práctico de Reparación y Bobinado de Motores Eléctricos

Héctor Castiñeira
$ 60 USD
$ 20 USD
4.73
(22)

Curso Reparación de Fuentes Conmutadas de PC y Equipos Electrónicos

Maximiliano Resch
$ 40 USD
$ 20 USD
4.6
(10)

Curso Localización de Fallas en Refrigeración en Heladeras/Neveras On/Off

Yamil Alarcón
$ 29 USD
$ 12 USD
¿Tienes una mejor respuesta a este tema? ¿Quieres hacerle una pregunta a nuestra comunidad y sus expertos?
Regístrate gratis