found a 16f15313 in my junk box which is from the same family tree
changing pins to suit all works as expected
Code:#CONFIG __config _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_OFF & _FCMEN_OFF __config _CONFIG2, _MCLRE_ON & _PWRTE_ON & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_OFF & _STVREN_ON __config _CONFIG3, _WDTCPS_WDTCPS_11 & _WDTE_OFF & _WDTCWS_WDTCWS_6 & _WDTCCS_HFINTOSC __config _CONFIG4, _BBSIZE_BB512 & _BBEN_OFF & _SAFEN_OFF & _WRTAPP_OFF & _WRTB_OFF & _WRTC_OFF & _WRTSAF_OFF & _LVP_OFF __config _CONFIG5, _CP_OFF #ENDCONFIG OSCCON1 = $62; OSCFRQ = %101 ' 16mhz DEFINE OSC 16 '-------------------- I/O ------------------------------------------------------ TRISa.2=0 ' output LED1 ANSELA = 0 ' ADC off all '******************************************************************************* ''************************* DT_INTS-14 ***************************************** ' INCLUDE "DT_INTS-14_16F15345-A.bas" ' Base Interrupt System INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts ' ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler TMR1_INT, _ToggleLED1, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM ' T1CLK = 1; CS FOSC/4; 534mS T1CON = $31 ; Prescaler = 8, TMR1ON @ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts ' '*************************** PIN NAMES ***************************************** LED1 VAR porta.2 ' test program for PIC16F15313 with DT_INTS-14 ' TMR1 interupts toggle LED1 ' Main: PAUSE 10 GOTO Main ' '******************************************************************************* '---------------------[TMR1 - interrupt handler]-------------------------------- ToggleLED1: TOGGLE LED1 ; 534mS @ INT_RETURN


Reply With Quote

Bookmarks