Jump to content

Reynard

EstablishedMember
  • Content Count

    688
  • Joined

  • Last visited

Everything posted by Reynard

  1. What is the actual PIC number you are using that has these instructions to give us a clue ? Cheers Reynard ps. Extended instruction set is not supported.
  2. The support for the 19XX devices is new to BoostC. It is possible that the IDE debugger does not yet support the IOC features of these devices i.e. +/- edge detection over the any edge detection of other chips. Cheers Reynard
  3. Hi Mike, Perhaps your "return" is unreachable and therefore been optimised out. Afterall, you do have 12 returns there already. :angry: Cheers Reynard
  4. Hi Tom, Tooltip display seems to require knowledge of the function prototype. I put my prototypes into my module header files and add the header files to the project window. The IDE seems to scan the header file and extract the prototypes. The tooltip only highlights the first two parameters on the argument list. I brought this up some time ago but it never got fixed. The autocompletion seems only to recognise compiler keywords and not everything that is in the browser window. There are still some broken bits to be sorted out yet. Cheers Reynard
  5. Hi Tom, The header file and any C book will reveal all. char bigbuffer[80] = ""; char *str1 = "string 1"; char *str2 = "string 2"; char *str3 = "string 3"; void main() { strcat(bigbuffer, str1); strcat(bigbuffer, str2); strcat(bigbuffer, str3); send_data(bigbuffer); } bigbuffer must be large enough to hold the largest length of string that you expect. The C string library contain many primitive functions that you can build on. Remember this is C and not C++ or VB. Cheers Reynard
  6. Hi Tom, strcat() is the standard C function. Look at page 76 of the latest BoostC manual and the string.h file. The string functions have probably been there since K&R invented C. Cheers Reynard
  7. Hi Moses, The code line: an_out = (an_in*3)/2; will probably not call the division function as it is a simple shift right 1 bit to get a divide by 2. Similarly, the code line: an_out = (an_in*8)/3; will probably not call the multiplication function as the *8 is again a simple shift to the left 3 bits. Write a simple piece of code and use the IDE debugger to test your code. Cheers Reynard
  8. Hi Alex, I suppose you could have 10 local vars all with the same name in 10 different functions. You would then have to identify in the browse window the function name as well. It could be done as well I suppose. Cheers Reynard
  9. Hi Babos, Did you install version 7.0 onto your PC ? I had the same thing a short while ago when playing with version 7.0. I am not sure what I was doing to cause it to appear. If you are using version 7.0 in a different install directory to keep both versions (6.97) you will probably have to rebuild your project file, recompile all your source files including any special Novo builds. I found that version 7.0 would pick up version 6.97 executables. Old project files may contain paths pointing to the older version. Cheers Reynard
  10. Hi Rye, The closest chip I have is an 18F4455 which is basically the same thing. I changed the clock source to HS and added a 20MHz xtal. Also removed any code bank 3 stuff. #pragma DATA _CONFIG1H, _FOSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H Chip is running a treat on my EasyPIC5 board with your config data. Cheers Reynard
  11. void_DIO_initial(void); tempo = ECUAL_scanf(void); Don't put void in the argument list. void_DIO_initial(); tempo = ECUAL_scanf(); Cheers Reynard
  12. 7 arrays of 96 chars is possibly the best solution for now. Cheers Reynard
  13. Hi Jean-Marie, Do you have USB enabled in the 4550 as it uses portc.4. Cheers Reynard
  14. Can't see anything wrong here. Assembler code is correct as you are comparing against a literal. Your problem may lie somewhere else. Cheers Reynard ps. Give us a clue to the chip type.
  15. Hi David, Thanks for the heads-up on this one. I will have to try and remember this should I have a need for these devices. Cheers Reynard
  16. The .tdf file sets the config address at 0x0000FFF8 and not 0x00300001 as expected. Perhaps this device has a new feature that I have not seen before. Cheers Reynard
  17. You are calling the read function just after you called the write function. Writing to EEPROM takes time (several ms) so you have to wait for the write cycle to complete first. You can do this by waiting a fixed delay (say 10ms), poll for write complete (while (eecon1.WR) {}) or use interrupts to tell you. Performing the read immediately after the write will probably abort the write operation. The SB manual says a bit about this. Cheers Reynard
  18. Here is a little something I was playing around with a year or so ago. It may want some refining. /************************************************************ * Return the exp of the fp number x. * ************************************************************/ #define LN2 0.69314718056 // ln(2) float exp(float x) { float y, r, twopwrn; int n; unsigned char sign; float_rounding_mode = float_round_down; // check if result would exceed max fp number (3.4028235e38 ish). if(float32_gt(x, 88.722839)) { float_raise (float_flag_overflow) return(0.0); } // calc. raise power val
  19. Most compilers will use a version of Henri Pade approximant. As Peter says it can be done with 7 muls and adds or there abouts to produce an accurate value. Finding the correct coefficients without stealing someone elses is the secret. Once BoostC supports floats as a basic data type it should be vary fast for all trig functions. Cheers Reynard
  20. Hi Allan, If you are using the internal 4MHz oscillator you will have to set this in the config word. _INTRC_OSC_NOCLKOUT Cheers Reynard
  21. Hi Jean-Marie, Good to read you are making progress. I2C is a simple interface. If the master does not like the data it received then it will have to ask for it again. You could append a checksum to your data packet (assuming you are writing for master and slave) or add a parity bit to each byte. The master could also send another message to the slave to acknowledge the received data if the slave want to move on and change its data. There are probably numerous solutions if you think they are worth it. Cheers Reynard
  22. Hi Jean-Marie, At some point during the read the master has to send a NAK. ACKDT = true; // output a NAK. When writing to the slave (data) the slave has to send a NAK to say MASTER give me no more data. Cheers Reynard
  23. Hi Jean-Marie, Your slave has not recieved a NAK from the master to say send no more data, therefore the slave still has control of the SDA line as it thinks the master wants more data. Cheers Reynard ps. What are you using to capture your waveforms ? Look like a nice tool to have.
  24. Hi Jean-Marie, You have a double write to sspbif in your routines. sspbuf = I2C_Donnee[Compteur]; do { // Yes - Write data again clear_bit( sspcon1, WCOL); // Done waiting, clear the WCOL flag sspbuf = I2C_Donnee[Compteur]; // Write the data to This may not be helping you. Cheers Reynard
  25. Hi Jean-Marie, The 'S' bit will be set for the complete message and will reset when a stop condition has been detected, when the 'P' bit will be set. Don't forget to check if the master is ACKing or NAKing the data you are sending. Cheers Reynard
×
×
  • Create New...