Jump to content

LcSD53

EstablishedMember
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

0 Neutral

About LcSD53

  • Rank
    Newbrie
  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, W MOVWF Int1BContext+D'1' SWAPF FSR, W MOVWF Int1BContext+D'2' BCF PCLATH,3 BCF PCLATH,4 GOTO interrupt *** interrupt service code omitted *** label268437047 BSF STATUS, RP0 BCF STATUS, RP1 SWAPF Int1BContext+D'2', W MOVWF FSR SWAPF Int1BContext+D'1', W MOVWF PCLATH SWAPF Int1BContext, W MOVWF STATUS BCF STATUS, RP0 SWAPF Int1Context, F SWAPF Int1Context, W RETFIE ; } interrupt function end How should work: Save W to a var at same bank than interrupted code. This way, after restoring STATUS, there is no need to mess with bank selectors and would work for targets with no common memory area. BTW: why not reserve last memory position in every bank to save W? Steps to reproduce: Big programs with multibank vars. Problem 100% reproduceable. Workaround: Check the code. On error, change wrong instruction messing with bank selectors to NOP. For PIC16F6xx with STATUS @ 0x83, BCF STATUS, RP0 opcode = 0x1283 BCF STATUS, RP1 opcode = 0x1383 IDE version: 5.9.5 Compiler: BoostC Compiler version: BoostC Optimizing C Compiler Version 2.2.2 Beta (for PIC16 architecture) Linker version: BoostLink Optimizing Linker Version 2.2.2 Beta Target device: PIC16F648A OS: Windows-XP
  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 here void main() { for(;;){;} } Expected messages: zztest.c(2): error: undefined symbol RCSTA zztest.c(2): error: undefined symbol SPEN BoostC Optimizing C Compiler Version 2.0.1 Beta (for PIC16 architecture) Under Windows-XP Pro
  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: PICXXXXX OS: Windows-XP
  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: Unlimited nesting of inlines - PC stack bigger than PIC one. Is the problem 100% reproduceable: 100% reproduceable IDE version: 5.9.1 Compiler: BoostC Compiler version: 2.0.1 Beta for PIC16 and PIC18 Target device: PICXXXXX (all PIC16 and PIC18) OS: Windows-XP Professional 2002 - SP2
  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 code) it is possible to debug the interrupt function. REQUEST: • a way to set values at the Watch Bar (acceptable) OR • an Interrupt Bar for set/clear flags (with side effects) and to set vars (better) SO we could ease step thru interrupt code! Regards, Luiz Domingues.
×
×
  • Create New...