Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by Reynard

  1. sprintf incorrect output

    Hi Jorge, I did my own implementation to get what I needed. The sprint does do negative numbers as well but sign is still in the wrong place (0-1 for -1). As you say it is a bit of a heavyweight. I am running at 64MHz with 64k rom PIC18 so not much of a problem. Cheers Reynard
  2. sprintf incorrect output

    The sprint function is not outputting the expected formatted string. sprintf(strBuffer, "%+03d", 1); This format is producing 0+1 and not +01 as expected. Tested OK with gcc avr compiler. SourceBoost C 7.42, Windows 10 64bit. Interesting that this function takes an unsigned int value but will format a signed number. Cheers Reynard
  3. sprintf incorrect output

    Hi Jorge, It is confusing to the reader when the prototype says unsigned int but I suppose they had to say something as the function is non standard to normal C. The output is still incorrect whether you specify +1 or -1 as the value. Cheers Reynard
  4. Hi Jaero, I think #pragma DATA is only for byte data and not words. I tried your config but with a different processor selected (PIC18F25K22), I forgot to change it to your chip, and I got Windows error box saying "c_pis18.exe has stopped working". Using "rom char *myromdata = {1,2,3};" just puts the data into RAM. Tried other forms from other compilers but no luck. Enums don't work right for me either. Using a compiler warning to promote SPAM telling us to try Chameleon is very bad practice. Deleted that offending line of code. Until Chameleon comes out of Beta and there exist a manual, Chameleon is just a toy at the moment. The limit of 256 bytes of rom per declaration in BoostC is a pain for me at the moment. I have to split my GLCD font files into pages. Will be moving this project to an ATmega very shortly. Cheers Reynard
  5. Hi Jareo, The Chameleon doesn't seem to like the '&' in the pragma line. If the header file contains the type 2 config style then use it. #pragma config FOSC = INTIO67 // Internal oscillator block, port function on RA6 and RA7 #pragma config WDTEN = ON // WDT is always enabled. SWDTEN bit has no effect #pragma config PWRTEN = ON // Power up timer enabled otherwise work out the bits you need and insert a hex value. Remember to define all the bits in all the config bytes or strange things can happen. SourceBoost doesn't recognise the default erased chip values. I still haven't worked out how to put data into rom with this compiler. Cheers Reynard
  6. Can't register the licence?

    One last stab in the dark guys, You did enter your name you used to make the purchase and not the product code. Cheers Reynard
  7. Can't register the licence?

    Hi Chris, Did you purchase the version 7 upgrade or are you trying to use the version 6 key ? Cheers Reynard
  8. Can't register the licence?

    Hi Koji, preg.exe has to be run as administrator for Windows 8 and 10 etc. Cheers Reynard
  9. Hi jartim, Are you sure INCF 0x47, W modifies the value in Trembler ? Cheers Reynard
  10. You are correct in your findings. Some of the tdf files are specifying the incorrect program address range. This is a subject that came up a few years ago but who wants to go through all the tdf files to find the errors. Hopefully they will be corrected as they are reported. My main work horses are the 26k22 and 46k22 which appear correctly specified. Cheers Reynard
  11. Check that the data sheets are not specifying number of instructions as one instruction is two bytes. Cheers Reynard
  12. First time using Chameleon and I'm stuck. enum MY_ENUM {ENUM0, ENUM1, ENUM2}; int myIntArray[ENUM2]; void main() {} Why can't I use an enum value as array size ? Works with BoostC. Cheers Reynard
  13. For W10 you must run preg.exe as administrator. Cheers Reynard
  14. I2C Configuration

    Hi, This is in the Extra Plugin Pack for simulating serial EEPROM chips like 24LC256. See the SourceBoost web site Products tab. Probably not what you may have thought it was. Cheers Reynard
  15. The RAM usage says you have used 128 bytes when only 68 bytes are available. This could be a problem. Cheers Reynard
  16. Hi Futz, Have you tried _porta (that is underscore porta). Cheers Reynard
  17. Guidelines For A Good Bug Report

    Hi Richard, Array[5] says you are asking for an array of 5 chars therefor 0 - 4 are the indexes. Yes it is a good product but needs to be brought up to date with the editor and a few bug fixes, 64 bit version etc. I am still using it today along with Novo. Cheers Reynard
  18. Hi, I moved 7.x from XP-32 over to W10-64 without any problems. No need to install previous 6.x version. I ran from Command Prompt as administrator. Navigate to the Preg directory and run it using the version 7 key. Preg does not provide any warnings about administrator privileges being required. Cheers Reynard
  19. Binary Semaphores

    Dave and Pavel, Having problems with binary semaphore being set when powering up. The binary semaphore storage byte '___sema' does not appear to get cleared during SysInit(). This byte is also not contained with the Sheduler structure. I am sure there is a good reason for that. If I clear this byte within my application (after SysInit() call) all works OK. Should I patch Novo.c or do you have a preferred solution. Cheers Reynard
  20. I2C Slave Address

    Yes you can just send the address byte. The stop will reset everything. The sspadd must be the address shifted left one bit same as you are transmitting. The slave mode should be 0110 = slave mode 7 bit. You won't get an ACK back until you read the ssbuf and clear any clock stretching. The interrupt flag will be set on address match and cleared when you read ssbuf. I don't use the supplied libraries so am not familiar with what they do. I am all interrupt driven so roll my own depending on needs. Cheers Reynard
  21. I2C Slave Address

    The data sheets are probably not all that clear. Get a copy of application notes AN734 and AN735. These will give you an idea of how to use the status register as a form of state machine. The PIC is not as good as the Atmel devices when it comes to I2C states, but they do work. Cheers Reynard
  22. I2C Slave Address

    The definition is in the Philips I2C specification. The master clocks out the 7 bit address plus the R/W bit (bit 0). The master will take the 7 bit address, shift it 1 bit left and append the R/W bit before putting into the transmit register. The slave will ignore bit 0 when performing the address comparison but the hardware will register the state of bit 0 in the status register so you know what is being asked. Cheers Reynard
  23. Float Math

    You need to add the float library to your project. Right click on the project and select "add files(s) to project" Find the library under SourceBoost/Lib. For you it will be "float.pic16.lib" See manual page 8. Cheers Reynard
  24. Works for me (SB V7.30) Just done a copy and paste and it compiles without error. Maybe you have a sneaky character in there somewhere. Cheers Reynard ps. Are you compiling for a PIC16LF1519 which doesn't have _VCAPEN ?
  25. Hi John, I can't reproduce the error from the info you have given. Some definitions missing for Ptr, uWorkVal, rx_data_buf_Ftdi[] and the function prototype for Read_BlockOfData. The PIC type may help the developers as well. Cheers Reynard