I haven't tried that code yet, will try it today later.
Regarding "other" code, there is none, except config and variable assignments.
Here's complete code for 16F1936 before I launch that part of code:
Code:;----[16F1937 Hardware Configuration]------------------------------------------- #IF __PROCESSOR__ = "16F1936" #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 ADCON1=%11110011 'enable adc internal reference and justify FVRCON=%11001111 'set internal reference to 4.096V OSCCON=%11110000 '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 32 'set oscillator speed ;____[ For 12F/16F only - Interrupt Context save locations]_________________ wsave var byte $20 SYSTEM ' location for W if in bank0 'wsave var byte $70 SYSTEM ' Alternate save location for W ' if using $70, comment out wsave1-3 ' --- IF any of these next three lines cause an error ?? ------------------- ' Comment them out to fix the problem ---- ' -- The chip being used determines which variables are needed ------------- wsave1 VAR BYTE $A0 SYSTEM ' location for W if in bank1 wsave2 VAR BYTE $120 SYSTEM ' location for W if in bank2 wsave3 VAR BYTE $1A0 SYSTEM ' location for W if in bank3 '---DO NOT change these----------------------------------------------------- ssave VAR BYTE BANK0 SYSTEM ' location for STATUS register psave VAR BYTE BANK0 SYSTEM ' location for PCLATH register ;----[ MIBAM Setup ]-------------------------------------------------------- BAM_COUNT CON 13 ; How many BAM Pins are used? INCLUDE "MIBAM.pbp" ; Mirror Image BAM module dta var porta.6 'LED PINS clk var porta.7 FET var portc.2 'current control fet pin VALUE VAR BYTE 'DIGIT DECODER VALUE VARIABLE LOLD VAR BYTE 'OLD LEFT VALUE FOR DECODER ROLD VAR BYTE 'OLD RIGHT VALUE FOR DECODER 'LED COLOR VALUES 'LEFT AND RIGHT LR VAR BYTE LG VAR BYTE LB VAR BYTE LX VAR BYTE 'LEFT BRIGHTNESS PACKED VAR BYTE 'LED PACKER ' RR VAR BYTE RG VAR BYTE RB VAR BYTE RX VAR BYTE 'RIGHT BRIGHTNESS new var byte 'current display value old var byte 'old display value maxbr var byte 'brightness holder CURBR VAR BYTE 'CURRENT RELATIVE BRIGHTNESS HOLDER ANIT var byte 'animation type digits DOTA var byte 'dot animation type x var word ' main small counter y var word 'additional var BR1 var byte 'brightness comparator 1 BR2 var byte '2 DCMODE var byte '6 or 10 digit mode selector tmp var byte 'temporal var for counting TEXTLINE VAR BYTE[8] 'MAIN ARRAY FOR TEXT STORAGE 'DIGIT PINS D0 VAR BYTE D1 VAR BYTE D2 VAR BYTE D3 VAR BYTE D4 VAR BYTE D5 VAR BYTE D6 VAR BYTE D7 VAR BYTE D8 VAR BYTE D9 VAR BYTE DF VAR BYTE 'TEMPERATURE SIGN DT1 VAR BYTE 'DOTS DT2 VAR BYTE eval var byte 'eeprom reader ELOC VAR BYTE 'EEPROM LOCATION ASM BAM_LIST macro ; Define PIN's to use for BAM BAM_PIN (PORTB,3, D0) BAM_PIN (PORTA,0, D1) BAM_PIN (PORTB,4, D2) BAM_PIN (PORTC,4, D3) BAM_PIN (PORTB,5, D4) BAM_PIN (PORTC,7, D5) BAM_PIN (PORTB,2, D6) BAM_PIN (PORTC,5, D7) BAM_PIN (PORTB,1, D8) BAM_PIN (PORTB,0, D9) BAM_PIN (PORTC,6, DF) BAM_PIN (PORTA,3, DT1) BAM_PIN (PORTA,2, DT2) endm BAM_INIT BAM_LIST ; Initialize the Pins ENDASM


Reply With Quote

Bookmarks