Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Reynard

  1. 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
  2. For W10 you must run preg.exe as administrator. Cheers Reynard
  3. 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
  4. The RAM usage says you have used 128 bytes when only 68 bytes are available. This could be a problem. Cheers Reynard
  5. Hi Futz, Have you tried _porta (that is underscore porta). Cheers Reynard
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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 ?
  13. 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
  14. 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
  15. Hi John, Internal Error is a common problem with sourceboost. I usually have comment out code until it goes away, then try to narrow it down to what causes it. Report your findings as a bug report. You may get it fixed but don't wait for it to happen soon. Cheers Reynard
  16. Unions are very useful as they allow you to overlay RAM areas that are not in concurrent use. Where you can, format numeric to ascii converted values directly into the output buffer avoiding an intermediate buffer. Put constant text strings into ROM and not hold them in RAM (all your AT commands etc.). When you are short on RAM you will find many tricks to get the best use out of it. Sometimes you can use unused registers to store the odd byte in. Good luck.
  17. Are you copying arrays to arrays when really you don't need to. Are you able to use 'unions' and share RAM.
  18. You are passing strings arrays ! Ouch ! You must have a good reason for not passing a simple pointer to the array then ? Cheers Reynard
  19. The linker is having a hard time trying to put all your arrays into the fragmented RAM that the PIC has. I am interested in how you are getting such large temporary variables. 'CompTempVar816' size:26 bytes and 'CompTempVar851' size:28 bytes What are you doing to get temporary variables this size ? Perhaps because of memory allocation difficulties, more temporary variables may be getting used due to all the RAM page switching that has to be done. You need to look at your memory maps to see how RAM is being used and what functions are using more than they should. Moving to the next size PIC is probably the best thing for it. Cheers Reynard
  20. #include <system.h> typedef unsigned char uint8; #define PULSE_CHANNELS 4 //#define CHANNEL_1 0 struct { uint8 moneyChannel; uint8 mechPulseInput; } mech; void Function(void) { uint8 channel; for (channel = CHANNEL_1; channel < PULSE_CHANNELS; ++channel) { } // end for. } Having some problems with compiler crashing with this simple code. I am getting an internal error and a dialog box pops up with 2 buttons saying debug and close program. Pressing close program doesn't close the program, the IDE just continues as normal. The (psudo) crash occurs when the constant CHANNEL_1 is undefined. Sourceboost C V7.30 Windows 10 64 bit. PIC18F26K22 Cheers Reynard
  21. Hi Jorge, I wouldn't rely on that working with BoostC. Cheers Reynard
  22. Use the -Op compiler option. See manual pages 23/24 on integer promotion. Cheers Reynard
  23. 1.4 Symbolic Constants A final observation before we leave temperature conversion forever. It's bad practice to bury ``magic numbers'' like 300 and 20 in a program; they convey little information to someone who might have to read the program later, and they are hard to change in a systematic way. One way to deal with magic numbers is to give them meaningful names. A #define line defines a symbolic name or symbolic constant to be a particular string of characters: #define name replacement list Thereafter, any occurrence of name (not in quotes and not part of another name) will be replaced by the corresponding replacement text. The name has the same form as a variable name: a sequence of letters and digits that begins with a letter. The replacement text can be any sequence of characters; it is not limited to numbers. #include <stdio.h> #define LOWER 0 /* lower limit of table */ #define UPPER 300 /* upper limit */ #define STEP 20 /* step size */ /* print Fahrenheit-Celsius table */ main() { int fahr; for (fahr = LOWER; fahr <= UPPER; fahr = fahr + STEP) printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32)); } The quantities LOWER, UPPER and STEP are symbolic constants, not variables, so they do not appear in declarations. Symbolic constant names are conventionally written in upper case so they can ber readily distinguished from lower case variable names. Notice that there is no semicolon at the end of a #define line. Text from K&R second edition. Cheers Reynard
  24. If the PC jumped to a certain location it would tell you in the manual. It is your responsibility to check the value of the divisor if there is a possibility of it being zero. As trossin said division is performed in software. If a divide by zero happens then the result would probably be the maximum value for the data type. If you are using the floating point library then the float_exception_flags would inform you that a divide by zero occurred. It is your responsibility to check these flags. See manual. If you write a small program and run the simulator you can test for yourself what happens. I hope this sheds some light for you. Cheers Reynard
  25. Thanks Pavel, That's where I went wrong. I forgot I had to use preg.exe to register the Goodies code then use goodies.exe Not a program (preg) you use very often. Many thanks, all working now. Reynard
  • Create New...