Jump to content

genome692002

EstablishedMember
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

0 Neutral

About genome692002

  • Rank
    Newbrie
  1. yes I saw it now in the manual.. but will it support arrays of ints or long instead of only char.. maybe on the next full realease..
  2. hello how do I declare that a variable is to reside in program memory... this can be done in mplab c18 by putting "rom" keyword before a variable declaration.. I know they are read only but.... how about in boostc?? and how can this variable be accessed.. thanks..
  3. Maybe put some intelisense in the code window.. like maybe when we put a dot in a config register like incon "intcon.giel" a list of available optios comeup for the register so we dont have to look up the datasheet as they are very hard to remember.. this would be great.. and make sourceboost a real kicking IDE... do you have something like this in plan..
  4. just wondering.. what changed from IDE 6.40 to pre-release v6.55..
  5. when I put a value close to 65535 say 64000 on a 16bit variable that is a member of an array.. the watch rebar shows it as a random negative number... a bug on the IDE maybe whats wrong with this..
  6. this looks like there something wrong with the simulator/debugger. The code is correct in assembly and the correct value is set in the Memory Window but the watch window display a negative number... can you confirm this...
  7. I think its not yet been fixed.. cause I downloaded and installed the 6.41 patch for boostc and it still gives wrong answer.. plus I found this other bug with arrays... this does not work also... #define TIMER16_OVERFLOW 65535 unsigned short Array16[3] = { 30000, 20000, 10000 }; Array16[0] = TIMER16_OVERFLOW - Array16[0];
  8. ok this is it dave... ok this is it this two conditional is totaly wrong it builds ok no compiler error but if you simulate it the result is compltely wrong... the condition should not return true as 1008 - 752 = 256 deffinitely greater than 40 this may be a bug and funny thing is theres no error the code is completely c compliant.. thanks dave I have now sourceboost 6.40 with the 6.41 patch and pic18f242 target just accepted defaults from the project menu NEW... #include <system.h> #define lit 40 void main() { unsigned short temp; unsigned short aa[3] = {752, 1008, 4520}; if( (aa[1] - aa[0]) < lit ) { temp = 10; } temp = aa[1] - aa[0]; if( temp < lit ) { temp = 10; } }
  9. Sorry about that did not know about the code tags.. the code thats having trouble is in the function SortArrayAssend I have made it to work using a temporary variable... that is in bold face.. sorry for the long post just scroll down and look at the highlight.. maybe this is just a code parsing bug thanks #include <system.h> #include "PIC18F242_ACM.h" void interrupt( void ) { //Handle timer0 interrupt if( intcon & (1<<T0IF) ) { portb = g_ucPortDataB; g_usInteruptTemp = g_usPeriodArrayB[0]; HIBYTE( tmr1h, g_usInteruptTemp ); LOBYTE( tmr1l, g_usInteruptTemp ); set_bit( t1con, TMR1ON ); IntrptCopyBtoA(); g_ucTimer1Count = 0; set_bit( g_SignFlags, 3 ); clear_bit( intcon, T0IF ); //clear timer 0 interrupt bit } //Handle timer1 interrupt if( pir1 & (1<<TMR1IF) ) { portb = portb ^ g_ucBitArrayA[g_ucTimer1Count]; g_ucTimer1Count++; if( g_ucTimer1Count < g_Timer1CntThresh ) { g_usInteruptTemp = g_usPeriodArrayB[g_ucTimer1Count]; HIBYTE( tmr1h, g_usInteruptTemp ); LOBYTE( tmr1l, g_usInteruptTemp ); } else { clear_bit( t1con, TMR1ON ); } clear_bit( pir1, TMR1IF ); //clear timer 1 interrupt bit } //Handle timer3 interrupt //if( pir2 & (1<<TMR3IF) ) //{ // clear_bit( pir2, TMR3IF ); //clear timer 3 interrupt bit //} } void interrupt_low( void ) { } void Timer1Sim() { unsigned char count; for( count = 0; count < g_Timer1CntThresh; count++ ) { portb = portb ^ g_ucBitArrayA[g_ucTimer1Count]; g_ucTimer1Count++; if( g_ucTimer1Count < g_Timer1CntThresh ) { g_usInteruptTemp = g_usPeriodArrayB[g_ucTimer1Count]; HIBYTE( tmr1h, g_usInteruptTemp ); LOBYTE( tmr1l, g_usInteruptTemp ); } else { clear_bit( t1con, TMR1ON ); } clear_bit( pir1, TMR1IF ); //clear timer 1 interrupt bit } } void main( void ) { Initialize_Variables(); Configure_PIC(); CalcPhaseData(); CopyPhaseDataBtoA(); StartTimers(); while( 1 ) { if( test_bit( g_SignFlags, 3 ) ) { //Test timer1 interuft Timer1Sim(); CalcPhaseData(); clear_bit( g_SignFlags, 3 ); } } } void Initialize_Variables() { g_ucSine0Offset = 0; g_ucSine1Offset = 12; g_ucSine2Offset = 6; g_usMaxPeriod = MAX_PERIOD; g_SignFlags = 0b00000100; g_Timer1CntThresh = 0; g_ucTimer1Count = 0; } void Configure_PIC() { //turnoff A/D converters adcon1 = 0xFF; //Configure port A as all inputs trisa = 0xFF; //Configure port B as all outputs trisb = 0x00; //Configure port C as all inputs trisc = 0xFF; //Initialize port A porta = 0x00; //Initialize port B portb = 0x00; //Initialize port C portc = 0x00; //Configure Timers //16bit, timer initially OFF, Prescaler not assigned 1:1 t0con = 0b00001000; //16bit, timer initially OFF, PreScaler 1:1, Timer1 OSC is off t1con = 0b10000100; //timer2 is off t2con = 0b00000000; //16bit, timer initially OFF, PreScaler 1:1, CCP isassigned but not used t3con = 0b10000100; //Configure Interrupts //TMR1, TMR2 interrupt priority high, CCP EUASRT A/D priority low ipr1 = 0b00000011; //TMR3 interrupt priority high set_bit( ipr2, TMR3IP ); //TMR0 interrupt priority high, All PORTB pulups disabled, rising edge.. intcon2 = 0b11110100; //All External interrupts disabled, Ext Priority is low intcon3 = 0x00; //TMR1 Overflow inrerrupt enabled, A/D, EUASRT, CCP interrupts disabled pie1 = 0b00000001; //TMR3 Overflow inrerrupt enabled set_bit( pie2, TMR3IE ); //TMR0 interupt enabled IPEN = 1 enables all high priority interrupts //low priority interrupts are enabled.. intcon = 0b11100000; /* //Set Timer0 mode set_bit( t0con, TMR0ON ); //enable timer0 clear_bit( t0con, T0CS ); //configure timer0 as a timer //Set Timer0 resolution clear_bit( t0con, T08BIT ); //set timer0 16 bit wide //Set prescaler assignment clear_bit( t0con, PSA ); //prescaler is assigned //Set prescaler rate clear_bit( t0con, T0PS2 ); //prescaler rate 1:2 clear_bit( t0con, T0PS1 ); clear_bit( t0con, T0PS0 ); //Set timer0 source edge selection set_bit( t0con, T0SE ); //increment on high-to-low transition on RA4/T0CKI pin //Enable interrupts (Timer0) intcon = 0xA0; */ } void StartTimers() { set_bit( t0con, TMR0ON ); //set_bit( t1con, TMR1ON ); //set_bit( t3con, TMR3ON ); } void StopTimers() { clear_bit( t0con, TMR0ON ); clear_bit( t1con, TMR1ON ); //clear_bit( t3con, TMR3ON ); } //#pragma OPTIMIZE "Op" void CalcPhaseData() { InitCalcPeriod( 0, g_ucSine0Offset ); InitCalcPeriod( 1, g_ucSine1Offset ); InitCalcPeriod( 2, g_ucSine2Offset ); SortArrayAscend(); SubArray(); ProcessCounters(); } void InitCalcPeriod( unsigned char ucPhasePos, unsigned char& ucSineOffset ) { //Compute Period result in g_usTemp g_ucTemp = g_ucSineTable[ucSineOffset]; FractionalMultiply( g_ucTemp, g_usMaxPeriod, g_usTemp ); if( ucSineOffset > 9 ) { g_usTemp = g_usMaxPeriod - g_usTemp; g_usPeriodArrayB[ucPhasePos] = g_usTemp; } g_usPeriodArrayB[ucPhasePos] = g_usTemp; //PortBit Calculation switch( ucPhasePos ) { case 0: if( g_SignFlags.0 == 0 ) { if( ucSineOffset > 9 ) { g_ucPortDataB.0 = 0; g_ucPortDataB.1 = 0; g_ucBitArrayB[0] = 0b00000010; } else { if( g_ucTemp > 0 ) //Temp Contains sinetable value { g_ucPortDataB.0 = 0; g_ucPortDataB.1 = 1; g_ucBitArrayB[0] = 0b00000010; } else { g_ucPortDataB.0 = 0; g_ucPortDataB.1 = 0; g_ucBitArrayB[0] = 0b00000000; } } } else { if( ucSineOffset > 9 ) { g_ucPortDataB.0 = 0; g_ucPortDataB.1 = 0; g_ucBitArrayB[0] = 0b00000001; } else { if( g_ucTemp > 0 ) //Temp Contains sinetable value { g_ucPortDataB.0 = 1; g_ucPortDataB.1 = 0; g_ucBitArrayB[0] = 0b00000001; } else { g_ucPortDataB.0 = 0; g_ucPortDataB.1 = 0; g_ucBitArrayB[0] = 0b00000000; } } } break; case 1: if( g_SignFlags.1 == 0 ) { if( ucSineOffset > 9 ) { g_ucPortDataB.2 = 0; g_ucPortDataB.3 = 0; g_ucBitArrayB[1] = 0b00001000; } else { if( g_ucTemp > 0 ) //Temp Contains sinetable value { g_ucPortDataB.2 = 0; g_ucPortDataB.3 = 1; g_ucBitArrayB[1] = 0b00001000; } else { g_ucPortDataB.2 = 0; g_ucPortDataB.3 = 0; g_ucBitArrayB[1] = 0b00000000; } } } else { if( ucSineOffset > 9 ) { g_ucPortDataB.2 = 0; g_ucPortDataB.3 = 0; g_ucBitArrayB[1] = 0b00000100; } else { if( g_ucTemp > 0 ) //Temp Contains sinetable value { g_ucPortDataB.2 = 1; g_ucPortDataB.3 = 0; g_ucBitArrayB[1] = 0b00000100; } else { g_ucPortDataB.2 = 0; g_ucPortDataB.3 = 0; g_ucBitArrayB[1] = 0b00000000; } } } break; case 2: if( g_SignFlags.2 == 0 ) { if( ucSineOffset > 9 ) { g_ucPortDataB.4 = 0; g_ucPortDataB.5 = 0; g_ucBitArrayB[2] = 0b00100000; } else { if( g_ucTemp > 0 ) //Temp Contains sinetable value { g_ucPortDataB.4 = 0; g_ucPortDataB.5 = 1; g_ucBitArrayB[2] = 0b00100000; } else { g_ucPortDataB.4 = 0; g_ucPortDataB.5 = 0; g_ucBitArrayB[2] = 0b00000000; } } } else { if( ucSineOffset > 9 ) { g_ucPortDataB.4 = 0; g_ucPortDataB.5 = 0; g_ucBitArrayB[2] = 0b00010000; } else { if( g_ucTemp > 0 ) //Temp Contains sinetable value { g_ucPortDataB.4 = 1; g_ucPortDataB.5 = 0; g_ucBitArrayB[2] = 0b00010000; } else { g_ucPortDataB.4 = 0; g_ucPortDataB.5 = 0; g_ucBitArrayB[2] = 0b00000000; } } } break; } } [B]void SortArrayAscend()[/B] { g_usSortTemp = g_usPeriodArrayB[0]; for( g_ucCount = 1; g_ucCount < 3; g_ucCount++ ) { if( g_usSortTemp < g_usPeriodArrayB[g_ucCount] ) { g_ucSortTemp = 0; g_ucTemp = g_ucBitArrayB[0]; } else { g_usSortTemp = g_usPeriodArrayB[g_ucCount]; g_ucSortTemp = g_ucCount; g_ucTemp = g_ucBitArrayB[g_ucCount]; } } g_usPeriodArrayB[g_ucSortTemp] = g_usPeriodArrayB[0]; g_usPeriodArrayB[0] = g_usSortTemp; g_ucBitArrayB[g_ucSortTemp] = g_ucBitArrayB[0]; g_ucBitArrayB[0] = g_ucTemp; if( g_usPeriodArrayB[2] < g_usPeriodArrayB[1] ) { g_usSortTemp = g_usPeriodArrayB[2]; g_usPeriodArrayB[2] = g_usPeriodArrayB[1]; g_usPeriodArrayB[1] = g_usSortTemp; g_ucTemp = g_ucBitArrayB[2]; g_ucBitArrayB[2] = g_ucBitArrayB[1]; g_ucBitArrayB[1] = g_ucTemp; } //Data is Already Sorted Min to Max //PortBitData Orring if( g_usPeriodArrayB[0] == 0 ) { g_usPeriodArrayB[0] = g_usPeriodArrayB[1]; g_usPeriodArrayB[1] = g_usPeriodArrayB[2]; g_Timer1CntThresh = 2; g_ucBitArrayB[0] = g_ucBitArrayB[0] | g_ucBitArrayB[1]; g_ucBitArrayB[1] = g_ucBitArrayB[2]; } else { [B]g_usSortTemp = g_usPeriodArrayB[1]; g_usSortTemp = g_usSortTemp - g_usPeriodArrayB[0]; if( g_usSortTemp < MIN_TIMER_DIFF )[/B] { if( g_usMaxPeriod == g_usPeriodArrayB[2] ) { g_Timer1CntThresh = 1; } else { g_usPeriodArrayB[1] = g_usPeriodArrayB[2]; g_Timer1CntThresh = 2; } g_ucBitArrayB[0] = g_ucBitArrayB[0] | g_ucBitArrayB[1]; } else { g_Timer1CntThresh = 3; } } } void SubArray() { g_usTemp = g_usPeriodArrayB[1]; g_usPeriodArrayB[1] = g_usTemp - g_usPeriodArrayB[0]; g_usPeriodArrayB[2] = g_usPeriodArrayB[2] - g_usTemp; } void CopyPhaseDataBtoA() { g_usPeriodArrayA[0] = g_usPeriodArrayB[0]; g_usPeriodArrayA[1] = g_usPeriodArrayB[1]; g_usPeriodArrayA[2] = g_usPeriodArrayB[2]; g_ucBitArrayA[0] = g_ucBitArrayB[0]; g_ucBitArrayA[1] = g_ucBitArrayB[1]; g_ucBitArrayA[2] = g_ucBitArrayB[2]; g_ucPortDataA = g_ucPortDataB; } void IntrptCopyBtoA() { g_usPeriodArrayA[0] = g_usPeriodArrayB[0]; g_usPeriodArrayA[1] = g_usPeriodArrayB[1]; g_usPeriodArrayA[2] = g_usPeriodArrayB[2]; g_ucBitArrayA[0] = g_ucBitArrayB[0]; g_ucBitArrayA[1] = g_ucBitArrayB[1]; g_ucBitArrayA[2] = g_ucBitArrayB[2]; g_ucPortDataA = g_ucPortDataB; } void ProcessCounters() { if( g_ucSine0Offset > MAX_TABLE_ENTRY ) { g_ucSine0Offset = 0; if( test_bit( g_SignFlags, 0 ) ) { clear_bit( g_SignFlags, 0 ); } else { set_bit( g_SignFlags, 0 ); } } else { g_ucSine0Offset++; } if( g_ucSine1Offset > MAX_TABLE_ENTRY ) { g_ucSine1Offset = 0; if( test_bit( g_SignFlags, 1 ) ) { clear_bit( g_SignFlags, 1 ); } else { set_bit( g_SignFlags, 1 ); } } else { g_ucSine1Offset++; } if( g_ucSine2Offset > MAX_TABLE_ENTRY ) { g_ucSine2Offset = 0; if( test_bit( g_SignFlags, 2 ) ) { clear_bit( g_SignFlags, 2 ); } else { set_bit( g_SignFlags, 2 ); } } else { g_ucSine2Offset++; } } //Arguments MULARG8 and MULARG16 are not modified inside the function so safe to use refference void FractionalMultiply( unsigned char MULARG8, unsigned short& MULARG16, unsigned short& RESULT16 ) { asm { Mul8x16: clrf _PRODUCT24 + 2 movf _MULARG8, W mulwf _MULARG16 movff _prodl, _PRODUCT24 movff _prodh, _PRODUCT24 + 1 mulwf _MULARG16 + 1 movf _prodl , W addwf _PRODUCT24 + 1, F movf _prodh, W addwfc _PRODUCT24 + 2, F Shr7_24: rlncf _PRODUCT24, F rlcf _PRODUCT24 + 1, F rlcf _PRODUCT24 + 2, F //infsnz _PRODUCT24 + 1, F //incf _PRODUCT24 + 2, F movff _PRODUCT24 + 1, _RESULT16 movff _PRODUCT24 + 2, _RESULT16 + 1 } } //#pragma OPTIMIZE "Oa" this is header file PIC18F242_ACM.h: //Configuration Bits for PIC18F242 #pragma DATA _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H #pragma DATA _CONFIG2L, _BOR_ON_2L & _BORV_27_2L & _PWRT_ON_2L #pragma DATA _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H #pragma DATA _CONFIG3H, _CCP2MX_OFF_3H #pragma DATA _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L //Code Protect and write protect bits are off #pragma DATA _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L #pragma DATA _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H #pragma DATA _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L #pragma DATA _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H #pragma DATA _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L #pragma DATA _CONFIG7H, _EBTRB_OFF_7H //Set clock frequency #pragma CLOCK_FREQ 4000000 //#pragma OPTIMIZE "Oa" //Defines #define MAX_PERIOD 4629 #define MIN_TIMER_DIFF 40 #define MAX_TABLE_ENTRY 17 //Function Prototypes void Timer1Sim(); void Initialize_Variables(); void Configure_PIC(); void StartTimers(); void StopTimers(); void CalcPhaseData(); void InitCalcPeriod( unsigned char ucPhasePos, unsigned char& ucSineOffset ); void SortArrayAscend(); void SubArray(); void CopyPhaseDataBtoA(); void IntrptCopyBtoA(); void ProcessCounters(); void FractionalMultiply( unsigned char MULARG8, unsigned short& MULARG16, unsigned short& RESULT16 ); //Variables in Access RAM unsigned char PRODUCT24[3]; unsigned char g_ucSineTable[18] = { 0, 22, 44, 64, 82, 98, 111, 120, 126, 128, 126, 120, 111, 98, 82, 64, 44, 22 }; unsigned short g_usPeriodArrayA[3]; unsigned short g_usPeriodArrayB[3]; unsigned char g_ucBitArrayA[3]; unsigned char g_ucBitArrayB[3]; unsigned char g_ucPortDataA; unsigned char g_ucPortDataB; unsigned char g_PortData[3]; unsigned char g_ucSine0Offset; unsigned char g_ucSine1Offset; unsigned char g_ucSine2Offset; unsigned short g_usMaxPeriod; unsigned char g_SignFlags; //Temporary Variables unsigned short g_usInteruptTemp; unsigned char g_ucTemp; unsigned char g_ucCount; unsigned short g_usTemp; unsigned short g_usSortTemp; unsigned char g_ucSortTemp; unsigned char g_Timer1CntThresh; unsigned char g_ucTimer1Count;
  10. sorry typo error::: Please look at the code above with the asterisk: #define MIN_TIMER_DIFF 40 I even try subtracting g_usSortTemp = g_usPeriodArrayB[1] -g_usPeriodArrayB[0]; and g_usSortTemp always equates to zero whatever value was in the array.. g_usSortTemp = g_usPeriodArrayB[1] - g_usPeriodArrayB[0]; if( g_usSortTemp < MIN_TIMER_DIFF ) { } all arrays are 3 eement only "us" means unsigned short and uc means usigned char originally this is the code that doesnot work: if( (g_usPeriodArrayB[1] - g_usPeriodArrayB[0]) < MIN_TIMER_DIFF ) { } I'am using sourceboost IDE 6.40. thanks...
  11. void SortArrayAscend() { //Find minimum first g_usSortTemp = g_usPeriodArrayB[0]; for( g_ucCount = 1; g_ucCount < 3; g_ucCount++ ) { if( g_usSortTemp < g_usPeriodArrayB[g_ucCount] ) { g_ucSortTemp = 0; g_ucTemp = g_ucBitArrayB[0]; } else { g_usSortTemp = g_usPeriodArrayB[g_ucCount]; g_ucSortTemp = g_ucCount; g_ucTemp = g_ucBitArrayB[g_ucCount]; } } g_usPeriodArrayB[g_ucSortTemp] = g_usPeriodArrayB[0]; g_usPeriodArrayB[0] = g_usSortTemp; g_ucBitArrayB[g_ucSortTemp] = g_ucBitArrayB[0]; g_ucBitArrayB[0] = g_ucTemp; if( g_usPeriodArrayB[2] < g_usPeriodArrayB[1] ) { g_usSortTemp = g_usPeriodArrayB[2]; g_usPeriodArrayB[2] = g_usPeriodArrayB[1]; g_usPeriodArrayB[1] = g_usSortTemp; g_ucTemp = g_ucBitArrayB[2]; g_ucBitArrayB[2] = g_ucBitArrayB[1]; g_ucBitArrayB[1] = g_ucTemp; } //Data is Already Sorted Min to Max //PortBitData Orring if( g_usPeriodArrayB[0] == 0 ) { g_usPeriodArrayB[0] = g_usPeriodArrayB[1]; g_usPeriodArrayB[1] = g_usPeriodArrayB[2]; g_Timer1CntThresh = 2; g_ucBitArrayB[0] = g_ucBitArrayB[0] | g_ucBitArrayB[1]; g_ucBitArrayB[1] = g_ucBitArrayB[2]; } else { //////////**************************************************** //this is where the problem is I had to use g_usSortTemp in order to work other wise doin the conditional directly with the arrays cause the condition always return true. I even try subtracting g_usSortTemp = g_usPeriodArrayB[1] -g_usPeriodArrayB[0]; and g_usSortTemp equates to zero always whatever value was in the array.. g_usSortTemp = g_usPeriodArrayB[1]; g_usSortTemp = g_usSortTemp - g_usPeriodArrayB[0]; if( g_usSortTemp < MIN_TIMER_DIFF ) { if( g_usMaxPeriod == g_usPeriodArrayB[2] ) { g_Timer1CntThresh = 1; } else { g_usPeriodArrayB[1] = g_usPeriodArrayB[2]; g_Timer1CntThresh = 2; } g_ucBitArrayB[0] = g_ucBitArrayB[0] | g_ucBitArrayB[1]; } else { g_Timer1CntThresh = 3; } } } Please look at the code above with the asterisk: #define MIN_TIMER_DIFF 40 I even try subtracting g_usSortTemp = g_usPeriodArrayB[1] -g_usPeriodArrayB[0]; and g_usSortTemp always equates to zero whatever value was in the array.. g_usSortTemp = g_usPeriodArrayB[0] - g_usPeriodArrayB[0]; if( g_usSortTemp < MIN_TIMER_DIFF ) { } all arrays are 3 eement only "us" means unsigned short and uc means usigned char originally this is the code that doesnot work: if( (g_usPeriodArrayB[0] - g_usPeriodArrayB[0]) < MIN_TIMER_DIFF ) { } I'am using sourceboost IDE 6.40. thanks...
  12. Yes im having problems too with arrays specially when you put them on conditional statements.. unsigned short Array1[3] = { 5, 2, 1}; if( Array1[0] < Array1[2] ) { ............................. } sometimes they work sometimes they do not.... yes I Agree with him hope there was some docs which tells what should work and what should not...
  13. Thanks already solved the problem.. the instructions needs to have a destination.. rlncf _var, F rlcf _var, F silly me, thought sourceboost will set the default destination to f.. thanks... anyway
  14. hello Compiler is giving an error trying to use bit shifting instruction of PIC18F242 example: void function1() { unsigned char var = 100; asm { rlncf _var rlcf _var } } after compiling the compiler gives an error: error: error in built-in assembly... what is wrong with this I am using sourceboost v6.40..
  15. What is source boost Multiplication behavior anybody?? unsigned char seg1 = 10; unsigned short seg2 = 4000; unsigned short seg3 = 2000; unsigned short segresult = seg1 * seg2 / seg3; does seg1 * seg2 result is always 16bit and then this is divided by seg3 which is 16bit.. is seg1 which is 8bit gets converted first to 16bit before multiplying.. if so wouldnt it be better if i just make seg1 also 16bit to avoid convertion.. see I'm trying to find out which one will make the code smaller and better.. anybody know... thanks.....
×
×
  • Create New...