The all 3 addr pins are connected to GND, which, according to the manual, should give write address of 64. However, it has zero response to my code. Wiring is correct and ports are configured properly. Anyways, here's the complete code - I'm just trying to enable and disable all outputs at same time each 2 seconds.
Code:
;----[16F1937 Hardware Configuration]-------------------------------------------
#IF __PROCESSOR__ = "16F1937"
#DEFINE MCU_FOUND 1
#CONFIG
cfg1 = _FOSC_INTOSC ; INTOSC oscillator: I/O function on CLKIN pin
cfg1&= _WDTE_OFF ; WDT disabled
cfg1&= _PWRTE_OFF ; PWRT disabled
cfg1&= _MCLRE_OFF ; MCLR/VPP pin function is digital input
cfg1&= _CP_ON ; Program memory code protection is enabled
cfg1&= _CPD_OFF ; Data memory code protection is disabled
cfg1&= _BOREN_OFF ; Brown-out Reset disabled
cfg1&= _CLKOUTEN_OFF ; CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
cfg1&= _IESO_ON ; Internal/External Switchover mode is enabled
cfg1&= _FCMEN_ON ; Fail-Safe Clock Monitor is enabled
__CONFIG _CONFIG1, cfg1
cfg2 = _WRT_OFF ; Write protection off
cfg2&= _VCAPEN_OFF ; All VCAP pin functionality is disabled
cfg2&= _PLLEN_OFF ; 4x PLL disabled
cfg2&= _STVREN_ON ; Stack Overflow or Underflow will cause a Reset
cfg2&= _BORV_19 ; Brown-out Reset Voltage (Vbor), low trip point selected.
cfg2&= _LVP_OFF ; High-voltage on MCLR/VPP must be used for programming
__CONFIG _CONFIG2, cfg2
#ENDCONFIG
#ENDIF
;----[Verify Configs have been specified for Selected Processor]----------------
; Note: Only include this routine once, after all #CONFIG blocks
#IFNDEF MCU_FOUND
#ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
#ENDIF
'nixie led clock electronics direct drive
DEFINE LCD_DREG PORTC
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 6
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 1500
DEFINE LCD_DATAUS 200
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in microseconds
ADCON1=%11110011 'enable adc internal reference and justify
FVRCON=%11001111 'set internal reference to 4.096V
OSCCON=%01110101 'SET INTOSC TO 8MHZ
ANSELE=%00000000 'enable adc input porte.2
ANSELA=%00000000 'disable ADC on A
ANSELB=%00000000 'disable ADC on B
ANSELD=%00000000 'disable ADC on D
TRISC=%00000000 'set PORTC as output all
TRISD=%00000000 'set PORTD as output all
TRISB=%00000000 'set PORTB as output all
TRISA=%00000000 'set PORTA 2 as input, others as output
TRISE=%00000000 'set PORTE as output all
WPUB=%00000000 'DISABLE B PULL UPS
OPTION_REG=%100000000
LCDCON=%00000000 'disable LCD controller pins
LCDSE0=%00000000
LCDSE1=%00000000
LCDSE2=%00000000
DEFINE OSC 8 'set oscillator speed
SCLM VAR PORTC.7: SDAM VAR PORTC.0 'pcf pins
drk:
I2CWRITE SDAM,SCLM,%01000000,0,[%11111111,%11111111] 'enable outputs
pause 2000
I2CWRITE SDAM,SCLM,%01000000,0,[%00000000,%00000000] 'disable outputs
pause 2000
goto drk
Any ideas?
Bookmarks