полтора года уже работают эти устройства , эта бага только на 0831KGS партии . схема на др компе (0,1 возле каждой ноги (2-3мм), тантал , стаб 2931 5в,плата двухсторонняя , все требования по разводке земли и питания учтены).
описание констант , переменных , и все лишнее не имеющие влияния на проблему поубирал
config __FOSC, CSW_FSCM_OFF & XT_PLL4
;---------------------------------------------------------------
;Turn on Watchdog Timer
config __FWDT, WDT_ON & WDTPSA_8 & WDTPSB_2
;---------------------------------------------------------------
;Set Brown-out Reset voltage and
;and set Power-up Timer to 16msecs
config __FBORPOR, PBOR_ON & BORV_45 & PWRT_16 & MCLR_DIS
;---------------------------------------------------------------
;---------------------------------------------------------------
;Set Code Protection On for the
;General Segment
config __FGS, CODE_PROT_ON
;******************************************************************************
; Program Specific Constants (literals used in code)
;******************************************************************************
;------------------------///////////////---------------------------------------
; Global Declarations:
;******************************************************************************
.global __reset ;The label for the first line of code.
.global __T1Interrupt ;Declare Timer 1 ISR name global
;******************************************************************************
;Uninitialized variables in X-space in data memory
;******************************************************************************
.section .Nbss, bss, xmemory
;------------------------------------------------------------------------------
;******************************************************************************
;Code Section in Program Memory
;******************************************************************************
.text ; Start of Code section
.org #START_ADDRESS
__reset:
NOP
NOP
MOV #__SP_init, W15 ; Initialize the Stack Pointer
MOV #__SPLIM_init, W0 ; Initialize the Stack Pointer Limit Register
MOV W0, SPLIM
NOP
NOP
;------------------------------------------------------------
;Add NOP to follow SPLIM initialization
CALL _wreg_init ;Call _wreg_init subroutine
;Optionally use RCALL instead of CALL
;------------------------------------------------------------
;----------------------------------
CLR PORTB
CLR LATB
MOV #0XFFFF , W0
MOV W0 , ADPCFG ; НАСТРОИТЬ КАК ЦИФРОВЫЕ
MOV #0B0000000000000000 , W0
MOV W0 , TRISB
;----------------------------------
CLR PORTC
CLR LATC
MOV #0B0000000000000000 , W0
MOV W0 , TRISC
;----------------------------------
CLR PORTD
CLR LATD
MOV #0B0000000000000100 , W0
MOV W0 , TRISD
;----------------------------------
CLR PORTF
CLR LATF
MOV #0B0000000000000001 , W0
MOV W0 , TRISF
;----------------------------------
CLR PORTG
CLR LATG
MOV #0B0000000000000001 , W0
MOV W0 , TRISG
;----------------------------------
;------------------------------------------------------------
;------------------------------------------------------------
;------------------------------------------------------------
CLR T1CON
CLR TMR1
MOV #0x3FFF, w0
MOV w0, PR1
BSET IPC0, #T1IP0
BCLR IPC0, #T1IP1
BSET IPC0, #T1IP2
BSET T1CON, #TCKPS0
BCLR IFS0, #T1IF
BSET T1CON, #TON
BSET IEC0, #T1IE ; Enable Timer1 interrupts
;-------------------------------------------------------------
;------------------------------------------------------------
;------------------------------------------------------------
RAB_ZIKL:
BTSC REGSLP,#BIT_SLEEP
PWRSAV,#SLEEP_MODE
CLRWDT
CODE............убирал...........
GOTO RAB_ZIKL
;*******************************************************************************
; Example code for Timer1 ISR
.org 0X2000
__T1Interrupt:
BTSS IEC0,#T1IE
GOTO INT_HIGT_OUT
BTSS IFS0,#T1IF
GOTO INT_HIGT_OUT
BCLR IFS0, #T1IF ; Reset Timer1 interrupt flag
;----------------------------------------------------
; отсчитали время до входа в слип и установили бит..........
RETFIE
;..............................................................................
;Subroutine: Initialization of W registers to 0x0000
;..............................................................................
_wreg_init:
CLR W0
MOV W0, W14
REPEAT #12
MOV W0, [++W14]
CLR W14
RETURN
; ----------------------------------------------------------------------------------------------
;..............................................................................
;--------End of All Code Sections ---------------------------------------------
.end ; End of program code in this file
-
- вижу что еррата (А3) на Sleep не учтена Илья(53 знак., 19.03.2009 13:09)