Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About LcSD53

  • Rank
  1. I had similar problems, solved by setting comparators (cmcon = 7) first, then setting i/o (trisa = 0). Seems to be related to i/o set to all inputs when messing with comparators (PIC16F648A).
  2. Check count declaration. Must be short (for a two bytes short integer) or (count > 1000) will never be true.
  3. Try this link: Header Files To keep code well organized, keep the header file in such a way that, if you compile the source code into a library, the header file will require no or small revision. But take care: some older BoostC version doens´t check header files date (don´t know about current version). And take a look at rs232 header, full of code: why don´t they follow those guidelines?
  4. Boost C also generate the right assembly (at least for a PIC16). But the target I´m testing (PIC16F648A) doesn´t have this EECON1<EEPGD> bit implemented. What is this about? ... clear_bit(eecon1,EEPGD); ...
  5. Sure there is an error in the code. But the compiler not giving you any clue about this error or its location ... any reason not to name this a BUG?
  6. /* BoostC Optimizing C Compiler Version 2.2.5 Beta (for PIC16 architecture) ... else_bug.c(11): error: missing semicolon ... NOTE: near 2 hours to find in the middle of a very big main function (many hundred lines) */ #include <system.h> char a, b; void main() // <<== missing semicolon error points here { if (a == 0) b = 1; a = 1; // after this line was inserted else // this else doesn´t match the if anymore b = 0; for (;;); }
  7. Try EAGLE PCB from www.cadsoftusa.com. The best and free for small projects.
  8. Bug description: The compiler generates wrong code to restore context from a bank other than zero. In the code bellow, context is saved to bank 1 (RP0 set). At end of restoring code, clearing RP0 after restoring STATUS is useless and buggy for programs using vars in bank other than 0 (big ones). ***** THIS CODE FAIL TO RUN ******** Int1Context EQU 0x00000070; bytes:1 Int1BContext EQU 0x000000E0; bytes:3 ORG 0x00000000 GOTO _startup ORG 0x00000004 MOVWF Int1Context SWAPF STATUS, W BSF STATUS, RP0 BCF STATUS, RP1 MOVWF Int1BContext SWAPF PCLATH
  9. I´ve got same problem, defining a longint type. When I renamed it to dword, code compiled ok. I run it thru the debugger and it is working perfectly.
  10. Compilation of undefined symbols generate meaningless messages. The fragment of code that follows defines the SPEN bit of register RCSTA for a HW USART. Reusing this code for a new project, the PIC target was changed to PIC16F84, the initial default. So, both symbols (RCSTA and SPEN) become undefined. Compiler flagged the error BUT with the following message: ... BoostC Optimizing C Compiler Version 2.0.1 Beta (for PIC16 architecture) ... zztest.c(2): error: missing semicolon ... #include <system.h> volatile bit ser_spen @ RCSTA.SPEN; //<<== compiler points error h
  11. Hard to find error with such kinda feedback. #include <system.h> void main() // ERROR: missing semicolon pointed here { // a lot of lines unsigned ch; // type of ch incomplete missed in the code // many lines more for (ch=0; ch<10; ch++); }
  12. Implement bit var declaration for compiler allocated static vars, so code that follows compiles ok. static char chReg; bit RegB7 @ &chReg.7;
  13. Bug description: Struct member access dot operators ('.' and '->') aren´t checking types. The *wrong* code that follows compiles and links OK. Steps to reproduce: #include <system.h> // struct TBuffer { char in; } aBuffer, *BufPtr; // void main() { aBuffer.in = 1; aBuffer->in = 2; // (ERROR: *aBuffer is not a struct) BufPtr.in = 3; // (ERROR: BufPtr is not a struct) BufPtr->in = 4; for(;;) {;} } Expected behaviour: Catch the ERRORs as commented. Problem 100% reproduceable. IDE version: 5.9.1 Compiler: BoostC Compiler version: 2.0.1 Beta Target device:
  14. Bug description: Calling an inline function winthin another inline function crashes BoostC. Steps to reproduce: See source code. The compiler generated a popup Error message Error: Access violation at 0x0044601E (tried to read from 0x00000004), program terminated. Removing the second inline compiles with no error. #include <system.h> inline char getA(char ch) { return ch; } inline char getB(char ch) //^^== compiler crashes - remove that inline to compile == { return getA(ch); } void main() { char ch; ch = getB('w'); for (;;) ; } Expected behaviour: U
  15. ... volatile bit ser_rcif @ PIR1.RCIF; // RCIF flag ... void interrupt(void) { if (ser_rcif) { //## USART Interrupt char ch = rcreg; // get char and clear RCIF flag buffer_in(ch); // put in a ring buffer } } void main(void) { ... for(;;) { ser_rcif = 1; // sets RCIF (usart RX flag) nop(); nop(); // some delay for latency char = buffer_out(); // get char from buffer ... do_something(); } } While debugging, stepping into [F11] the line ser_rcif = 1; sets the RCIF flag and generates an interruption (fine!). This way (embedding the debug symmulation into the cod
  • Create New...