Jump to content

Picxie

Moderator
  • Content Count

    277
  • Joined

  • Last visited

Everything posted by Picxie

  1. It is hard to determine the problem without seeing the existing code and errors the new compiler is generating,
  2. Sounds like the 'read, modify, write' problem For further details search the relevant data sheet, microchips website or google for read, modify, write
  3. Picxie

    Cheap Pics

    In case you don't know the ROHS directive is coming into force in the UK and I believe EU on 1st July 2006. All (with a few exceptions ) electronic equipment bought into service after that date must be free of certain hazardous substances, lead being one of them. This has proved a real pain in the asp for manufacturers having to use lead free solder and have lead free finishes on boards and only buy in components with lead free tinning. The chip manufacturers have been phasing in lead free finishes for the last couple of years. However it seems that Microchip have a lot of leaded stoc
  4. I found formula & implemented in c but in that formula we do square root of 32 bit number? But BoostC Lib not support Square root. Is there any way to found square root of 32 bit number in c without Lib. ? Regards Tectona <{POST_SNAPBACK}> Yes! google for calculating square root, find out how its done and then write your own function to do it. You can apply this simple procedure as often as you wish.
  5. google for the correct formula and apply it using C.
  6. See http://sourceboost.ipbhost.com/index.php?showtopic=1640
  7. Picxie

    Bit Copy

    Manipulating output port bits is a bit hairy on PICs due to the read modify write problem (its documented in every PIC spec sheet.) You would be better mirroring the port bits, manipulating the mirror then writing the mirror out to the port.
  8. Ok. That makes alot of sense. I was testing with thumbsweels pulled from broke monitors, and car-stereos - and I think they are mechanical, not optical; causing some type of spike feedback, and 1/2 way results. When I trigged it and watched using a LED it goes so fast I cant sense what its doing. I think I need to get an oscilliscope of data-logger of some sort so I can actually tell what's going on. <{POST_SNAPBACK}> Mechanical rotaries work by having a couple of tracks with a pattern of conductive pads. The contacts are brass/bronze fingers stroking the tracks. A
  9. Indeed it is. Quoting the help file To add some boiler plate text to each new file created from IDE create a directory called 'boiler.plates' inside the SourceBoost installation directory and than create a file with the name of your current toolsuite inside this new directory with the boiler plate text you want to insert into newly created files.
  10. Apply the appropriate equation. BTW for square I should imagine pk/2
  11. Dont know for thumbwheels, you should check the data sheet for the part. Have a look at www.alps.com, they make a lot of switch and encoder parts. A rotary encoder I have has clicks and when at rest the legs read 00 or 11. But they follow the above pattern when moved.
  12. There seem to be two questions here First of all how is RMS calculated and Secondly how to do floating point with integer only mathematics. Google for RMS and you can get an article in wikipedia which details RMS calculation. Though I guess that you want the simple Vrms = Vpk/ SQRT(2) Now down to precision and integer stuff Square root of 2 is 1.414blah blah. We can get fair enough precision (you may want more) by assumming 1.41. #define SQRT2 1.41 So voltageRms = voltagePeak/ SQRT2; Though that wont work as we only have integers. so multiply voltagePeak and rough square ro
  13. BoostC18 v6.31 Suppose I have two structs, one contains instances of the other. typedef struct person_struct { char Age; char Height; } PERSON; typedef struct couple_struct { PERSON Man; PERSON Woman; char Years; } COUPLE; COUPLE Jones; and I had some functions which take the structs as parameters COUPLE setYears(COUPLE couple, char years) { couple.Years = years; return couple; } PERSON setAge(PERSON person, char age) { person.Age = age; return person; } Then using these functions is fine. It compiles and works. Jones = setYears(Jones, 12); Jones.Man = setAge(Jon
  14. Might be worth checking the listing to see if if(rbif) { led = 1; rbif = 0; } is doing what you think it is doing.
  15. Except you arent generating the interrupt from timer0! //Enable interrupts (Timer0) intcon = 0xA0; set_bit(intcon,RBIE); set_bit(intcon,GIE); The comment does tend to throw you This is blue.
  16. Please use code tags when posting code. You need to clear timer0 interrupt flag in intcon during the interrupt otherwise the interrupt gets called immediately on exit. PICs aint too bright!
  17. A long time ago I did this in assembler on another (better) processor. The bits change like this direction B 00 01 11 10 direction B 10 11 01 00 look at whats going on. In direction A when the the lower bit changes state it becomes the opposite of the higher bit, when the higher bit changes state it becomes the same as the lower bit In direction B when the lower bit changes state it becomes the same as the higher bit, when the higher bit changes state it becomes the opposite of the lower. All you have to do is determine which bit has changed, compare it to the other
  18. Sorry for the confusion, my post was about how the plugin should be if they were to update it not what you should see currently. I have made these suggestions in the enhancement forum.
  19. Excellent points. Regards Dave <{POST_SNAPBACK}> Oh well, while you've got the lid off how about a ...
  20. Probably - but i purchased a compiler to do the dirty work for me. <{POST_SNAPBACK}> Currently youcan do any delay from 1us to 255ms with only one function call. A delay_100ms function would plug the gap between 255ms and 1s
  21. DrStein99 has queried the action of the switch plugin at http://sourceboost.ipbhost.com/index.php?s...7213entry7213 Just to add The button plug in should have an option of short to high or short to low. The two state checkbox needs changing to to the options of latching or momentry. As I see it any stateliness should be controlled by my software, The button should only mimic mechanical latching. The LED block needs an option for the port to sink or source.
  22. The button plug in should have an option of short to high or short to low. The two state checkbox needs changing to to the options of latching or momentry. As I see it any stateliness should be controlled by my software, The button should only mimic mechanical latching. The LED block needs an option for the port to sink or source.
×
×
  • Create New...