when reading the 12 values in table1 number 1 and 7 are read as zero.
Using the b'xxxxxxxx' notation in table2 the numbers read correctly.
There is no problem with any of the other numbers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
;Program compiled by Great Cow BASIC (0.98.04 2018-10-20 (Windows 32 bit));Set up the assembler options (Chip type, clock source, other bits and pieces)LISTp=16F18326, r=DEC
#include<P16F18326.inc>__CONFIG_CONFIG1, _CLKOUTEN_OFF&_RSTOSC_HFINT1&_FEXTOSC_OFF__CONFIG_CONFIG2, _BOREN_OFF&_WDTE_OFF&_MCLRE_OFF__CONFIG_CONFIG3, _LVP_OFF&_WRT_OFF__CONFIG_CONFIG4, _CP_OFF;********************************************************************************;Set aside memory locations for variablesIEQU32Q1EQU33SYSSTRINGAEQU119_HEF_DUMMYEQU34;********************************************************************************;VectorsORG0pageselBASPROGRAMSTARTgotoBASPROGRAMSTARTORG4retfie;********************************************************************************;Start of program memory page 0ORG5BASPROGRAMSTART;Call initialisation routinescallINITSYS;Start of the main program;for i=1 to 24clrfISysForLoop1incfI,F;readtable test1,i,q1movfI,WmovwfSYSSTRINGAcallTEST1movwfQ1;next imovlw24subwfI,WbtfssSTATUS, CgotoSysForLoop1ENDIF1SysForLoopEnd1BASPROGRAMENDsleepgotoBASPROGRAMEND;********************************************************************************INITSYS;Set up internal oscillator;Handle OSCCON1 register for parts that have this register;asm showdebug OSCCON type is 100 'This is the routine to support OSCCON1 config addresss;osccon type is 100;OSCCON1 = 0x60 ' NOSC HFINTOSC; NDIV 1 - Common as this simply sets the HFINTOSCmovlw96bankselOSCCON1movwfOSCCON1;OSCCON3 = 0x00 ' CSWHOLD may proceed; SOSCPWR Low powerclrfOSCCON3;OSCEN = 0x00 ' MFOEN disabled; LFOEN disabled; ADOEN disabled; SOSCEN disabled; EXTOEN disabled; HFOEN disabledclrfOSCEN;OSCTUNE = 0x00 ' HFTUN 0clrfOSCTUNE;asm showdebug OSCCON type is 102 'therefore not CHIPFamily 16;osccon type is 102;OSCFRQ = 0b00000000clrfOSCFRQ;Ensure all ports are set for digital I/O and, turn off A/D;SET ADFM OFFbankselADCON1bcfADCON1,ADFM;Switch off A/D Var(ADCON0);SET ADCON0.ADON OFFbcfADCON0,ADON;Commence clearing any ANSEL variants in the part;ANSELA = 0bankselANSELAclrfANSELA;ANSELC = 0clrfANSELC;End clearing any ANSEL variants in the part;Comparator register bits for 12F510,16F506, PIC16F1535 classes;C2ON = 0bankselCM2CON0bcfCM2CON0,C2ON;C1ON = 0bcfCM1CON0,C1ON;Turn off all ports;PORTA = 0bankselPORTAclrfPORTA;PORTC = 0clrfPORTCreturn;********************************************************************************TEST1movlw25subwfSysStringA, WbtfscSTATUS, Cretlw0movfSysStringA, WaddlwlowTableTEST1movwfSysStringAmovlw(highTableTEST1)&127btfscSTATUS, Caddlw1movwfPCLATHmovfSysStringA, WmovwfPCLTableTEST1retlw24retlw255retlw255retlw255retlw255retlw255retlw255retlw0retlw255retlw255retlw255retlw255retlw255retlw0retlw255retlw255retlw255retlw255retlw255retlw255retlw255retlw255retlw255retlw255retlw255;********************************************************************************;Start of program memory page 1ORG2048;Start of program memory page 2ORG4096;Start of program memory page 3ORG6144;Start of program memory page 4ORG8192;Start of program memory page 5ORG10240;Start of program memory page 6ORG12288;Start of program memory page 7ORG14336END
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's always very worrying to install a new version, but I've done it and it works (though when opening the IDE I've found it best to ignore the configuration change as it can throw off the programmer configurations).
Anyway it gives much the same when compiled to ASM
;Program compiled by Great Cow BASIC (0.98.06 2019-06-12 (Windows 32 bit));Need help? See the GCBASIC forums at http://sourceforge.net/projects/gcbasic/forums,;check the documentation or email w_cholmondeley at users dot sourceforge dot net.;********************************************************************************;Set up the assembler options (Chip type, clock source, other bits and pieces)LISTp=16F18326, r=DEC
#include<P16F18326.inc>__CONFIG_CONFIG1, _CLKOUTEN_OFF&_RSTOSC_HFINT1&_FEXTOSC_OFF__CONFIG_CONFIG2, _BOREN_OFF&_WDTE_OFF&_MCLRE_OFF__CONFIG_CONFIG3, _LVP_OFF&_WRT_OFF__CONFIG_CONFIG4, _CP_OFF;********************************************************************************;Set aside memory locations for variablesIEQU32Q1EQU33SYSSTRINGAEQU119;********************************************************************************;VectorsORG0pageselBASPROGRAMSTARTgotoBASPROGRAMSTARTORG4retfie;********************************************************************************;Start of program memory page 0ORG5BASPROGRAMSTART;Call initialisation routinescallINITSYS;Start of the main program;for i=1 to 24clrfISysForLoop1incfI,F;readtable test1,i,q1movfI,WmovwfSYSSTRINGAcallTEST1movwfQ1;next imovlw24subwfI,WbtfssSTATUS, CgotoSysForLoop1SysForLoopEnd1BASPROGRAMENDsleepgotoBASPROGRAMEND;********************************************************************************INITSYS;Set up internal oscillator;Handle OSCCON1 register for parts that have this register;asm showdebug OSCCON type is 100 'This is the routine to support OSCCON1 config addresss;osccon type is 100;OSCCON1 = 0x60 ' NOSC HFINTOSC; NDIV 1 - Common as this simply sets the HFINTOSCmovlw96bankselOSCCON1movwfOSCCON1;OSCCON3 = 0x00 ' CSWHOLD may proceed; SOSCPWR Low powerclrfOSCCON3;OSCEN = 0x00 ' MFOEN disabled; LFOEN disabled; ADOEN disabled; SOSCEN disabled; EXTOEN disabled; HFOEN disabledclrfOSCEN;OSCTUNE = 0x00 ' HFTUN 0clrfOSCTUNE;asm showdebug The MCU is a chip family ChipFamily;the mcu is a chip family 15;asm showdebug OSCCON type is 102;osccon type is 102;OSCFRQ = 0b00000000clrfOSCFRQ;Ensure all ports are set for digital I/O and, turn off A/D;SET ADFM OFFbankselADCON1bcfADCON1,ADFM;Switch off A/D Var(ADCON0);SET ADCON0.ADON OFFbcfADCON0,ADON;Commence clearing any ANSEL variants in the part;ANSELA = 0bankselANSELAclrfANSELA;ANSELC = 0clrfANSELC;End clearing any ANSEL variants in the part;Set comparator register bits for many MCUs with register CM2CON0;C2ON = 0bankselCM2CON0bcfCM2CON0,C2ON;C1ON = 0bcfCM1CON0,C1ON;Turn off all ports;PORTA = 0bankselPORTAclrfPORTA;PORTC = 0clrfPORTCreturn;********************************************************************************TEST1movlw25subwfSysStringA, WbtfscSTATUS, Cretlw0movfSysStringA, WaddlwlowTableTEST1movwfSysStringAmovlw(highTableTEST1)&127btfscSTATUS, Caddlw1movwfPCLATHmovfSysStringA, WmovwfPCLTableTEST1retlw24retlw255retlw255retlw255retlw255retlw255retlw255retlw0retlw255retlw255retlw255retlw255retlw255retlw0retlw255retlw255retlw255retlw255retlw255retlw255retlw255retlw255retlw255retlw255retlw255;********************************************************************************;Start of program memory page 1ORG2048;Start of program memory page 2ORG4096;Start of program memory page 3ORG6144;Start of program memory page 4ORG8192;Start of program memory page 5ORG10240;Start of program memory page 6ORG12288;Start of program memory page 7ORG14336END
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm getting a problem with reading a table such as the following:
when reading the 12 values in table1 number 1 and 7 are read as zero.
Using the b'xxxxxxxx' notation in table2 the numbers read correctly.
There is no problem with any of the other numbers
Interesting.
Can you tie this download a little more please.
Compiler version?
Got code that compiles? So, I can look at the ASM.
Is this chipset specific?
version 98.04 (I've not updated recently!).
All the numbers in the test table should be 255, but the middle two lines give the first value as 0.
Can you test with the latest version please? That is the baseline I would have to investigate against.
It's always very worrying to install a new version, but I've done it and it works (though when opening the IDE I've found it best to ignore the configuration change as it can throw off the programmer configurations).
Anyway it gives much the same when compiled to ASM