Jump to content

Tom

EstablishedMember
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Tom

  • Rank
    Newbrie
  1. Since nobody has replied, I'm assuming that none of versions of C2C (not even the newest) will support signed arithmetic. Is this true?
  2. I'm using C2C version 4.1.5e Is there any way to declare signed 8-bit or 16-bit variables?
  3. I had this problem too. The easiest way around it is to add this to one of your header files: char EEEDATA @ 0x10C; char EEEADR @ 0x10D; char EEEDATH @ 0x10E; char EEEADRH @ 0x10F; char EEECON1 @ 0x18C; char EEECON2 @ 0x18D; Now you can use these new definitions in your source code, ie. use EEECON1 instead of EECON1 and all the bank switching will work perfectly.
  4. Yes, I'm using the C2C compiler with MPLAB-ICD right now and it works very well. All you have to do is add this line to your source file: #pragma RESERVE_ADDR_0 nop
  5. I set the configuration bits and ID locations by using the in-line assembler: asm __config _XT_OSC & _WDT_OFF & _PWRTE_OFF & _BODEN_OFF & _LVP_ON & _CPD_OFF & _WRT_ENABLE_ON & _DEBUG_OFF & _CP_OFF The compiler will give you a "Warning: Not known opcode" message but if you assemble the resulting ASM file using MPASM the configuration bits will get set properly.
  6. Thanks for your help! The script is a good idea. Unfortunately the one that you posted doesn't work, it writes the wrong value to PCLATH. Here is one that works a little better and doesn't require you to declare any extra temporary variables: Name: "PIC string fix" Debug: off Pattern: 00. clrf PCLATH 01. addwf PCL, F Action: insert 00 " addlw LOW($+4) ; Add our starting location " insert 01 " btfsc STATUS, C ; If the result is >= 0x100 " insert 02 " incf PCLATH,f ; Then set PCLATH bit 0 " insert 03 " addlw -(LOW($+1)) ; Restore the original value in W"
  7. First off I must say that C2C is an excellent compiler and a very good deal for the price. I'm using C2C-plus version 4.1.5e and the problem that I'm having comes from having too many strings in my program. I'm writing a user interface and my program has many CONST strings like this: lcd_prints("Main menu"); If I only have 20 or 30 strings, everything works fine. But when I add a few dozen more strings, the new strings can't be accessed. I stepped through the object code and I've found the instruction that causes the problem: const_param_code clrf PCLATH addwf PCL, f For the first few strings, the resulting value of PCL+W is less than 0x00FF so everything works OK. But when I have a lot of strings the resulting value is over 0x0100. Because PCLATH is set to 0, the processor jumps to some odd location below 0x0100 and executes code that it's not supposed to. Will this be fixed in a future version? If not is there any way to work around this problem?
×