Jump to content

Reynard

EstablishedMember
  • Content Count

    688
  • Joined

  • Last visited

Everything posted by Reynard

  1. The problem is not with the compiler but the linker. It cannot find the .lib to resolve the symbols. I do not use MPLAB, gave it up years ago as it crashed every 10 minutes. Check the library path setup in MPLAB. The integration part of the SB install should have done it for you. Cheers Reynard
  2. Are you using MPLAB ? If so did you include the library libc.pic.16.lib (or 18). Cheers Reynard
  3. Doh! I didn't spot that one. The case is expecting the ascii character '4' but the function WritetoLcd is being past the value of 4. Cheers Reynard
  4. Did you add the semicolon in your code ? char m_temp_buf[6]; // buffer to hold 6 bytes for the number "4" Cheers Reynard
  5. How about somrthing like this: #include <system.h> #include <float.h> long Dialer = 1111111; long C0; void Calc() { C0 = float32_to_int32(float32_mul(float32_from_int32(Dialer), 23.86892)); } void main() { float_rounding_mode = float_round_up; Calc(); } Reynard
  6. Hi Carlos, You can give Dialer a value when you declare it. float Dialer = 1111111; or You can delare Dialer as static and the compiler sets it to a value of zero (unless told otherwise). static float Dialer; // Dialer is initialised to zero; Cheers Reynard
  7. Good you solved it. Works if you declare Dialer as a float. Cheers Reynard
  8. Try this bcf _status,C Page 64 of manual: prefix variables in assembler with underscore. Register variables are also in lower case. Cheers Reynard
  9. Hi Carlos, You could scale you numbers down to fit into a single precision but you would still lose resolution. You could search the web for source code to impliment double precision (64 bit). You could look at a hardware numeric processor chip such as the Micromega Corp. uM-FPU64. You use an SPI or I2C interface and computation speeds are not to bad. Cheers Reynard
  10. Hi Carlos, The floating point library is only single precision therefore there is a limit in the number of digits it can work with. The manual indicates 7 digits. Cheers Reynard
  11. Hi Robert, The manual says it is included in stdio.h. Have you included this header file into your code ? Cheers Reynard
  12. Hi Bryan, The large libraries are used if you select the large model option. This will use 2 byte indexing for large arrays > 256 bytes. Cheers Reynard
  13. Hi Mike, Functions like atoi() and itoa() are standard to C and are always found in the stdlib.h. The lightweight functions are just additions/extensions from Sourceboost and are added into the standard library. I suppose a reference could have been added to the manual but they assume you know something about C. Familiarize yourself with all the non-pic specific header files or find an editor that can do a search files (grep). Cheers Reynard
  14. Hi Mike, Standard conversion functions are in the standard library. Use stdlib.h Cheers Reynard
  15. Hi Jorge, The external variables (SFR's) are declared using the 'extern' keyword as you would do in any C file that references a variable declared in another file. The library does not know what the target device is so there no specific device header can be included. As the bit definitions are common to all pic families they can be defined within the eeprom.c file. GIE is not used with the eecon1 SFR that I can see. Cheers Reynard
  16. Hi Pavel, I see it now. It is the eeorpm_write than is causing the problem. void eeprom_write(unsigned char address, unsigned char data) This function is using eeadrh when it shouldn't as it is only an 8 bit address. Cheers Reynard
  17. The eeprom.h check for the EEARDH being declared. If declared it chooses the short address else the char address functions. A quick test using PIC18F2520, 256 bytes EEPROM did not grumble about EEARDH not being found. Cheers Reynard
  18. Dave, Pavel, Thanks for the fix for this function. Project ticking away nicely using 7.10RC Regards Reynard
  19. The compiler did what the user asked it to do, create 3 consecutive words starting at address 0x8007. The fact that the target device has no usable rom there for the third word is neither here nor there. The user may have had some cunning scheme to cope. If you turn on all warnings the linker actually give you a warning. Warning: Overlapping user DATA at address:0x00008008 The programmer gave the clue to what was wrong. I to have stared at a piece of code with an obvoius error but just could not see it until the penny dropped. Cheers Reynard
  20. Hi Guys, Use the '&' ampersand to string config options together. #pragma DATA _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF #pragma DATA _CONFIG2, _LVP_OFF Cheers Reynard
  21. For those who need an un-official fix and with source code for libc, modify the code for strstr with sub-string in rom to: for( ; ( ptr1 = strchr( ptr1, ptr2[0] ) ) != NULL; ptr1++ ) { for( i=0, j=0 ; ; ) Both for loops modified. Cheers Reynard
  22. Searching a string within a string fails if sub-string is in rom. This code incorrectly finds a match. Sub-string in rom. rom char *MSG_REC_READ = "REC READ"; strcpy(receiveBuffer,"+CMGR: 'REC UNREAD','+441234567890',,'12/06/11,13:37:48+04"); pBuff = strstr(receiveBuffer, MSG_REC_READ); This code does not find a match, as it shouldn't. Sub-string in ram. strcpy(receiveBuffer,"+CMGR: 'REC UNREAD','+441234567890',,'12/06/11,13:37:48+04"); pBuff = strstr(receiveBuffer, "REC_READ"); A pointer is not being reset on an unmatched character somewhere after a match has starte
  23. Hi Tom, Given variable declaration has been allowed within a for loop, then yes it is a bug to access the variable out of scope. I don't think SourceBoost C says it is ISO C99 compatable, but as it allows some C++ features to be used, it should conform to the rules. Cheers Reynard
  24. The reason I asked about the declaration inside the for loop was I tried another compiler (MikroC) and it wasn't having it. After some reading on the net, C99 introduced the declaration into the for loop. Cheers Reynard
  25. Hi Tom, True if you are using C++, but are variable declarations allowed in C in a for loop ? Cheers Reynard
×
×
  • Create New...