Jump to content

bongo

EstablishedMember
  • Content Count

    34
  • Joined

  • Last visited

Everything posted by bongo

  1. i really tried to be nice ;-) i already tried different ways to tell the compiler about array size...and all i get is an "error: missing right paren". that's all ;-( using global access is no way to go, as i have multiples of these arrays, but all of them have to be processed using the same functions. the only way i see so far is to convert to a 1D array and calculate position myself, although i think that ansi c should support 2D arrays in functions. thanx!
  2. hi it's a 18f2525. with a bank size of 256 bytes, i think this shouldn't be a problem. regards bongo
  3. i try to include a 2 dimensional arrays in function calls to have functions doing some modifications to arrays. a very simple example to initialize the array is: unsigned char MATRIX[15][16]; void Init (unsigned char *myMATRIX) { unsigned char x,y; for (x=0;x<15;x++) { for (y=0;y<16;y++) { myMATRIX[x][y] = x+y; } } } void main (void) { Init(MATRIX); } i would expect that a memory area of 240 bytes would be reserved for the array variable MATRIX, and when calling the Init function, the start address of this memory range would be given to t
  4. When using BoostC from within the Sourceboost IDE, it does a smart build, i.e. only the files that have changed are recompiled. for all other files, the existing object files are used. When using MPLAB (as an ide for BoostC) to build the design (i think i have to, if i want to debug using ICD2), then on each build, all files are compiled again, no matter if they have changed or not. So this is the most time consuming part of the process when fixing little bugs, as it compiles only on 1 core of a quad core cpu. Is there a way to configure MPLAB to only recompile the files that have cha
  5. that's how i finally did it, after giving up the initial concept... thanx! bongo
  6. to make it a bit more clear, here the test proggy: #include <system.h> #include "SndSer18a1.h" void main (void) { unsigned char myarray[15][6]; PrintMyArray(myarray); } void PrintMyArray(unsigned char *thearray) { for (unsigned char i=0; i<6;i++) { SsTxt(thearray[i]); } } void SsTxt(const unsigned char *text) { unsigned char loop; loop = 0; while ((text[loop] !=0) && (loop < 255)) { SsSend(text[loop++]); } } i get an error message for the line SsTxt(thearray); which tries to give a single line of text to the SsTxt fun
  7. i have a multidimensional array, or let's say an array of string, that i would like to use in a function. i tried ma make an exemple: unsigned char myarray[15][6]; these are 6 strings of the lenght of 15 characters. right? now i want to give this to a function by reference: PrintMyArray(myarray); the function itself is defined as: void PrintMyArray(unsigned char *thearray) { for (unsigned char i=0; i<6;i++) { printF(thearray[i]; } } unfortunately, this does not work. what do i have to do to give an array to function? thanx!
  8. hi dave thanx for the answer! looks like i found the reason: when optimization is enabled in mplab, it compiles and links with the -O1 option, resulting in the bigger code. when i turn off optimization, there is no such option and the result shrinks to 92%. this behaviour does not really make sense, but at least it seems to work now! thank you! regards bongo
  9. when i build my project within the sourceboost IDE (6.96), it requires for 92% program memory. when i build from within MPLAB 8.40, after a very looooong time i get a failure and it reports that the design requiers for 101% program memory. i already had this effect with former projects, requiring for about 10% more program memory when building them from within MPLAB. what am i doing wrong? thanx!
  10. i usually put functions that i use for several projects into libraries instead of adding the c-code to each project. now i have some functions that have to behave different, depending on the pic i use, i.e. there are some lines that are different for slow or fast processors. i used to have a #ifdef slowpic <code for slow version> #else <code for fast version> #endif construct in my source code, while having a #define slowpic in the globaldefs.h file when using a slow processor. now i think about moving the whole stuff into a .lib file. is it p
  11. looks like eeprom simulation does not work. for details, refer to detailed description (within this forum)
  12. looks like this is really a simulator bug!! running the procedure on a real target works!
  13. i also tried the built-in eeprom access tasks. looks like they also do not work on the simulator. what am i doing wrong???
  14. i try to use the sourceboost simulator to check if my code for accessing internal eeprom of a 18f2525 works. my code is a 1:1 asm2c conversion of the microchip example code. result: - my code does not work (on the simulator, didn't test on a target yet) - the simulator shows strange behaviour SIMULATOR PROBLEMS: i first write a few bytes of data to the eeprom window of the simulator (manual entry). this looks ok, but as soon as i start simulation (first step into the program, with no access to the eeprom), each even address of the eeprom gets overwritten with the data from th
  15. hi pavel i have 6.93rc2 What compiler version do you use? Version 6.92 is broken in this respect (projects that have sources not in the project dir may not build). All other releases are fine (including 6.93 RC).. Pavel
  16. it's not the .h file, that is not found. it's the .c file! the .c file is in the same folder as the .h file (which is not the project folder). it can be added to the sources, but the compiler does not find it. as a workaround, i separately compiled the .c as a library. like this it works, but sometimes, it would be easier to handle it as an external .c file instead of a library. so far, no solution!
  17. some sources, which are common for several projects, are stored in a common folder. i try to access them from my sourceboost pic18 project. by including the .h file in my main source file: #include "..\PIC18LIBS\LCD_A_r0_01\P18LCDA2r0_01.h" and by adding the .c file (P18LCDA2r0_01.c) to the source files list in the project (i use sourceboost from within mplab). doing so, the main project .c file (test4main.c ) is compiled, but the P18LCDA2r0_01.c file, i've also added to the source files list, gives an error: FATAL: Unable to open input file: D:\SwDesign\pic\test4\P18LCDA2
  18. My next project will need for 2 serial ports: - capturing port: 9600bps rs232 input, getting data packets every then and now - management port: 9600bps rs232 bidirectional, attached to a terminal for configuration/status i'd like to use a pic18. what's the best way to do this? is dual serial supported by the sourceboost rs232 routines? is there an example for dual serial? thanx!
  19. i'll have a look at it. thanx!
  20. where can i find novo rtos examples, to learn how to use this os?
  21. ok, i think this means that the linker checks it. right? i wasn't really sure if my code requires for 8 or 9 levels, and i cannot add an additional level to check the linker, as i only have 5 words left in code memory. btw: it still would be nice to get an info on the stack levels used, as i don't think that the stack level for the icd is added from the linker. is it? bongo
  22. does the boostc compiler, resp. the boostc linker do a stack check? boostc builds a tree, i.e. it can check how many stack levels are used. does it check this value against the max available stack levels of the selected pic chip? it would be nice if the linker could show max stack levels of the main prog and max stack levels of the interrupt routine(s), to be checked at least manually: max stack pgm + max stack irq (+1 if icd is used) <= hw stack size
  23. i need to directly access a ram address from a debug task. i.e. to dump the content of the pic's internal ram for debugging, i need to read the ram's content. therefore, i cannot simply declare the whole ram area of the pic as an array@0x00, as this would reserve this range, and it would not be used to store any data. so how can i directly read from (and eventually write to) a ram address using boostc on a pic18f ? thanx bongo
  24. i have to transfer an array (about 2-16 bytes wide) to a function, i call. how do i have to declare this array (array of char) and how do i have to transfer it to the function? can i also give an array of char back to the calling function? thanx! bongo
  25. hi pavel i think there is something wrong with the interpretation of the switch/case/default statement. when using a single switch/case/default statement, this seems to work, so that the default section is only executed, if no case condition is matching. ...but when there is a case section, containing another switch/case/default statement, this lower order switch/case/default seems not to work properly: after a 'break' in a case section, the program seems not to proceed at the end of the whole switch/case/default construct. it simply goes to the next 'case'...and to the next 'case', and at
×
×
  • Create New...