Hi, I am trying to build a timer based application and using PIC16F72. My problem is that my PIC is not responding to the Serin data. I am using DT_INT to achieve the timing function.
Please help me understand if I am missing something.
My code goes like this:
I dont know what I am missing but my PIC is not respnding to the serial data. The buzzer should beep once, but it doesn't. Am I missing something?Code:; ;-----------------PIC16F72--------------------------- Include "modedefs.bas" INCLUDE "DT_INTS-14.bas" ; Base Interrupt System INCLUDE "ReEnterPBP.bas" ; Include if using PBP interrupts DEFINE OSC 4 ' OSCCON defaults to 4MHz on reset ;-------------CONFIGURATION FUSES SET HERE------------------------- @ __Config _XT_OSC & _WDT_ON & _PWRTE_ON & _BODEN_ON & _CP_ALL ;---------VARIABLES DECLARED HERE---------------- PAUSE 100 Rx Var PortB.7 buz var PortA.2 green var PortA.1 red var PortA.0 relay var PortC.2 delay VAR word delayset var word get0 var byte o var bit s var bit get1 var byte ;------------REGISTERS SET HERE------------------------ ADCON1=7 PORTA=0 PORTB=0 PORTC=0 TRISA = %000000 TRISC = %00000000 TRISB = %10000000 OPTION_REG = %10000000 ' RAPU = off PORTA=0 PORTC=0 PORTB=0 s=0 high red : pause 500 : high relay : pause 500 : high green : pause 500 : high buz : pause 1000 low red : pause 500 :low relay : pause 500 : low green : pause 500 : low buz : pause 1000 ; the above works fine ;---------INTERRUPTS DECLARED HERE------------------------------ ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler TMR1_INT, _delaystop, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM T1CON=$31 ;-------------INTERRUPTS ENABLED HERE----------------------------- @ INT_ENABLE TMR1_INT ; Enable external (INT) interrupts ; the int works fine as I have toggled an led in ISR and it does toggle at regular intervals ;----------------MAIN PROGRAM STARTS HERE------------------------ main: game: Serin PortB.7, N2400,["D33",get0] high buz : pause 50 : low buz : pause 500 Select case get0 ; all select case statements go here which switch on the relay part & leds as well End Select goto main ;------------------[INTERRUPTS - interrupt handler]--------------------------------------------------- delaystop: ; All code to switch off the relay goes here after certain time has elapsed @ INT_RETURN
I can upload the missing code if needed.


		
		
						
					


Bookmarks