Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Nigel Goodwin said:Yes, as long as you choose the uC that you wrote the code for!
Kryten said:Is it possible to make a program and choose uC afterwards?
Kryten said:Ok well i see i need to specify my questions better
This is what i asked on the top !!
Nigel Goodwin said:You need to bear in mind that while C is far more portable than assembler, it's not really that portable, particularly for micro-controllers, where their specific requirements modify the language accordingly.
Torben said:Actually, that's not the question you asked. You asked about microcontrollers in general, not PICs specifically. And the answer is only partly correct: if you write code depending upon features present in the higher-end PICs but not in the lower-end ones, that code will not work properly in lower-end PICs, regardless of the include file.
You can write code targetted at a range of uCs, as long as the code works within spec on all of them. Writing code which could run equally well on an 8051, a PIC, or an ATMEGA would be worth it only if the program didn't rely on any of the advanced features of any of the uCs. Choose the environment and code to it.
Within a family (like PICs) you could do some makefile magic to make it work, but I don't think it would be worth it.
Torben
Kryten said:Ok Torben. (sounds like your a Norwegian bloke)
Im aiming at using the PIC16 family as i need a ADC that has hig resolution cos im measuring 100A @ 2.5V (hmm must aplify it a bit )
Torben said:Sounds neat. What are you measuring?
Torben
Kryten said:Im measuring the amout of energy going to and from a batterybank (made by a windmill) in order to figure out if there is need for aditional chargeing capasity. I also need to logg and mediate the measurments to a SD card
Kryten said:Im looking to everything my self (this beeing a school procject the final one (Im a engineer this summer )) So i have to do as much as i can in limited time..