Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About richardc

  • Rank

Profile Information

  • Gender
  • Location
    Gippsland VIC,Australia
  1. no did you look at the link I gave you ? plug some numbers in it , see for yourself how numbers are represented as exponent and mantissa when floating point vars are used .
  2. float fnum ; reserves 4 bytes and makes a pointer for a float structure fnum = 23.4567; will convert 23.4567 to a floating point representation and store it like this 0x52 @fnum,0xa7 @fnum+1,0xbb@fnum+2,0x41@fnum+3 fnum = 0x41bba752; will convert 1,102,817,106 to a floating point representation and store it like this 0x4f @fnum,0x77 @fnum+1,0x83@fnum+2,0x4e@fnum+3
  3. maybe this will explain how 4 bytes are used to represent a fp number https://www.h-schmidt.net/FloatConverter/IEEE754.html as pavel indicated 0x41bba752 is a long = 1,102,817,106 a float is a pointer to 0x52,0xa7,0xbb,0x41 stored in 4 consecutive bytes as a float 0x41bba752 = 0x4e83774f
  4. would that not yield fnum=1,102,817,106 and it's not going to fit in an int I would use a union to load a float from a byte array
  5. your problem description sounds exactly like a classic Read Modify Write issue. did you try using a shadow GPIO register ? post your code if you want some help
  6. http://www.microchip.com/webinars.microchip.com/WebinarDetails.aspx?dDocName=en556253 watch this View streaming media version:
  7. trisc = 0x00; latc = 0x00; these commands in setup() will look like a serial start to the receiver, don't set the tx line low or to an output
  8. int x; int y=0; int arr[] = {65,22,39,48,57,66} ;// Create an array x = arr[y]; // where y is some value from 0 to 5 ..... Get some value out of the array should result in x == 65 if it won't compile then the error is elsewhere , you might get more help if you post your entire code ,snippets are never going to address some issues
  9. int arr[6]@0xA0 = {65,22,39,48,57,66}; won't work int arr[] = {65,22,39,48,57,66}; will why the @0xA0 there is no need to specify a location for the array unless you have a specific need
  10. see this link I had the same trouble http://forum.sourceboost.com/index.php?showtopic=5328
  11. my experience is the same on a hp4520 (i5) win7 both xc8 and mikroc compile in milliseconds sourceboost in minutes, I saw post somewhere indicating that spourceboost works much faster using windows xp
  12. I use this routine , returns 2 for a long press 1 for a normal press else 0 char chksw(void) // button pressed { static byte was_pressed=0; static int count=0; char event=0; byte now_pressed=porta0; if ((now_pressed) && (was_pressed) ) { if (count >3000) event=2; else if (count >300) event=1 ; } else event=0; if (now_pressed) { count++; } else count=0; was_pressed=now_pressed; return event; }
  13. can I use tmr1 counter from the input of RC0? and count and total transitions ? don't see why not , then display transitions / sec/pulses-per gallon (its tmr1) or feed pulses into and interrupt pin (rb0/ int would be easy) and determine count per/sec . the pic will have no trouble with 30KHZ pulse rate
  14. looks like my reply disappeared i'll try again. the linker seems to be unable to access lib files in "program files\sourceboostlib\" seems not to like space in directory name solution for mplabx ,copy lib files to a directory with no spaces in path
  • Create New...