Jump to content

DTPIC

EstablishedMember
  • Content count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About DTPIC

  • Rank
    Regular
  1. Thanks Reynard, but that was my first thought too! (I have been caught before with that one...). If I play with the compiler, I can see some CPUs with values which agree with the data sheets, and others which do not - even though the data sheets are all specifying "Flash (bytes)", not "instructions. Also, some TDF files agree with the associated data sheets (eg 44K22), while the TDF for 66K22 does not agree - so there is some inconsistency worth checking! I have had a situation where the compiler says "all OK, only used just over 50% program memory" while MPLAB wont load the hex file into the CPU properly because its too big.... As an example, my current project uses 66K22: the compiler is saying "ROM available 131072 bytes, ROM used 34774 bytes (26.1%)". But if I look at the program area of the hex file in MPLAB, it has a limit of 0xFFFF (65536 bytes) and has code up to 0x87D6 (which is the 34774 bytes specified by the compiler). Clearly not 26% utilisation..... more like 53%.... compiler is wrong....
  2. In SourceBoostC ver 730, I have noticed that some 18Fxx'K'yy CPUs are returning the wrong program memory size in the IDE (it is often 2x correct value). Examples: 66K22, 67K22. If I look in the .tdf files for these CPUs, the same "incorrect" values are present as the program memory ranges. The values are 2 x the size shown in the CPU data sheet. This leads to the IDE \ compiler stats being incorrect after a compile (eg, "ROM available:", "used:" and "free:" figures) I have checked a "correct" CPU tdf (eg, 44K22) and the size agrees with the data sheet, and is displayed correctly in the IDE... Am i missing something about the "factor of 2" on these CPUs? Or is this just a plain and simple error? (It has turned up on other CPUs too - I will list as I come across them again...) This may be "old news" now that Chameleon is out, but other users may still be working on 730 and it may be that the error has carried over into the new compiler support files....
  3. I am planning a project for a customer targetting PIC 18F67K40. This CPU doesn't appear to be supported in the current release (7.30). Can you please provide an update to allow me to use this part? In general, how is BoostC tracking the appearance of new processors? Is anybody producing new support files for them? Either within the Sourceboost company or the community? Is there some other community support site that I should be looking at? (I have in the past edited the _PIC18Fxxx.TDF, map.txt and other include files, to add a CPU, but its a tricky process - is there a guide published for "how to" add a CPU to the list? Or could you write one? Or should I write one based on what i have done in the past for you to edit?) Is there a mechanism for users to contribute "mods" they have made for new CPUs, so they can be sent back into the community? Still using your product after many years (back to early 6.xx) - many thanks for a great little compiler & IDE. Just wish you would do a PIC32MX one...(!)
  4. It would be handy if a large Read-Only data array could be created in ROM space, to be accessed only by using the table pointer instructions. This array would have to be of a type which relaxes the array size limit of 256 bytes (on PIC18). At the moment, I can achieve this with a 'C' program I have written which reads the data I want in the large array from an 'h' file and appends extra 'S' records to the SourceBoost .hex file output. The PIC programmer then programs the target with code + data array, which can then be read with a table pointer routine. However, all this is tedious and timewasting, and especially frustrating as the original data for the large table array is in an 'h' file format anyway! Could you perhaps consider this "large Read Only array" as an addition to a future release of Sourceboost C?
  5. Regarding C compiler \ ver 7.30... are the Flash \ codespace sizes in the 18F86K22, 18F87K22 TDF files correct? They seem twice as large as the data sheet implies.... My compiler was reporting the ROM available 2 x the size the data sheet says- it also caused some problems loading the code when I exceeded the "50%" value, implying that the compiler had got it wrong. The sizes of the 85K22 and 65K22 <do> agree with the datasheet however... Please check - if I've got it wrong, my apologies !
  6. Hi, currently I have a program which uses 2 dimensional arrays to store lists of menu options. These reside in RAM, because Sourceboost wont support 2D rom arrays. (I am using SB 7.30). I now have to expand my menus and dont have the space for them in RAM - so I must re-work the code to place the data in rom. I can get around the 2D array problem with a little work - but in checking on my options in the forum, I see that someone mentioned a "single rom page limit" on rom arrays. Could you explain a little more please? Is this a limit "per "rom array" or on rom arrays, total? I could do with a more detailed explanation of rom data limits in the compiler, if you have the time... also any comments on what i am trying to do and whether the method is the best approach, etc
  7. ...erm, have just realised that there is a difference in the K20, K22 cores - they are not "functionally equivalent" - so best ignore my last post....
  8. I am still using BoostC Ver 6.97. I have created a project using 18F44K20, (a 3V3 CPU) but would like to move it to a 44K22 (a 5V CPU). However, 6.97 doesn't support 44K22 in its target list. Could you please confirm for me: 1) As far as I can tell, the K20 and K22 are functionally equivalent - so can I compile for a K20 and use the code on a K22? 2) If so, I guess this also applies for 45K20/K22, 46K20/22, etc? 3) Finally, from another part of this topic, it seems I could add the K22 variants by creating (copy K20 part and edit?) a .h, and .tdf file and adding an entry to the map.txt file? I will move up to release 7 when time allows! But I must get this job out first.... Many thanks!
  9. Think I may have found the answer... The problem is indeed duplication of the "volatile char..." definitions for the CPU registers. 1) I copied the PIC16Fxxx.h file from Sourceboost\include to a file in my project directory, (renaming it for safety) and converted all the "volatile char..." definitions to "extern volatile char...". 2) In the library project, I included the above .h file and the compilers own boostc.h file. This now works fine - the loader routine is called from its fixed location at the top of memory, does its stuff (including calls to main program routines) and finally jumps to 0x000 to start the new code... Interestingly, the RAM is unchanged during this load, so you can leave a main program variable set from the loader module (define it as extern...) to indicate that the restart has occurred as a result of a download, etc... I'd still be interested if anyone can find a cleaner way of doing it... There doesnt seem to be much documentation that I could find on the subject of precompiing libraries, even though the feature is there in BoostC - perhaps someone could write a little something to shed some light on this area?
  10. Hi, I am interested in creating a boostc library for a serial loader (<not> a classic "bootloader", but more of an "on demand" loader, for a specific customer application). To get the serial loader routine to locate at a specific fixed address in memory, I have defined a project which links with the -rb xxxx option; as there is no main() function in the project, I guess this has to be compiled as a library... The routine contains asm instructions, for which it seems the compiler must have system.h included, to be able to interpret the asm. This compiles ok as a library. But when I try to link this into my main project, the linker says failure Error: Duplicate global var: cmcon Error: Duplicate global var: eedata ...etc. I think the project is seeing 2 copies of system.h (one from the library, one from the main part), both of which call in the _PIC16Fxxx.h header, and this is causing the duplication. But I must have system.h in my library project, or else it doesnt understand the asm instructions... I have tried including boostc.h into the lib instead of system.h, but this seems to be too generalised, ie, also does not allow the library asm commands to be understood... There must be a way of compiling a library a) containing asm commands and without a duplicate system.h - but I havent found it yet! Any ideas?
  11. Might be able to answer this one myself....(!) the buffer is passed to the called function as a pointer - so Im probably being given the sizeof the <pointer>, not the buffer, inside the called function... ...so sizeof() is working ok after all....(!) Hope this has been of some use to someone doing something similar... I suppose I will need to pass the buffer length into the called function as another parameter if I really want to use it there... anybody know any other way?
  12. Hi, I have a function into which Im passing a pointer to a char buffer; the sizeof() operator indicates different buffer lengths depending on whether it is used inside or outside the called function: void rcv_RS232_msg(char *buffer); // function def for called function... void myfunc(void) // calling function { char msgbuf[20]; // char message buffer printf("size of buffer outside function is: %d",sizeof(msgbuf)); rcv_RS232_msg(msgbuf); // call the function, passing buffer in... : : } // end of calling function void rcv_RS232_msg(char *buffer) // the called function { printf("size of buffer inside function is: %d",sizeof(buffer)); } The result of the first printf is 20 (correct) The result of the second printf is 2 (?!?) It appears that the length of the buffer is not reported correctly using sizeof() from inside the called function into which the buffer has been passed...... I dont think this behaviour is intentional - can you verify this behaviour? Is it on the fix list? Thanks!
  13. Think Ive got 2 problems... First, I thought that the "compile" option was the incremental compile of editied source files.... Second, I thought that the "Build" option was a complete buld of all source files - seems that <this> is the incremental option, as it generates a new "makefile.gen" when used... I think the terminology may be different in Microsoft Visual Studio? This may be where my confusion comes from... The "build" option has shown up another problem - it says Building... FATAL: Don't know how to make: D:\Sourceboost\My Done I think its because I have some path names with embedded spaces, (eg "D:\Sourceboost\My Lib Functions...", as above) which require quotes around them - I have looked in the makefile.gen, and the use of quotes around such pathnames seems to be 'unpredictable' - also notice that the file paths and names in project.__c do not have quotes around them.... Should I be declaring the path\filenames in some other way to get around this, or is this an issue? Can I 'fudge' it temporarily by manually editing the project.__c file to include quotes around the paths? Thanks!
  14. OK, thanks for that - agree that the only reliable workaround I could find was to use a numeric constant - puzzling thing was that the use of certain #defines seemed to work, while others didn't(!) - I'll wait for the fix!
×