Programming the PIC16F877 in c++

Status
Not open for further replies.

RawTechie

New Member
Hi, i've got the MPLAB installed and i was hoping someone here can help me figure out how to code the PIC program in c++. Actually, if someone can how me how to code a recursive function in asm that would do as well. because the only reason why i want to use c++ is that i don't know how to code a recursive c++ function in asm. thanks!
 
I guess you mean "C" and not "C++" the major difference being "C++" facilitates objects oriented approach while its predecessor does not. And till date very few "C++" has been developed for microcontrollers. If you want to work with objects then try for "OOPIC" microcontrollers.

What exactly do you mean by recursion? Do you mean iterations? Like for-loop or some recursive maths polynomial stuff?
 
oh right, thanks. i don't really need the object oriented approach, its just that i've used c++ before that's all.

anyway, what i meant by a recursive function is a function that calls itself e.g.:

function factorial(n)
if n=0 then result:=1
else result := n*factorial(n-1)

so the result of the above function is the factorial of the number n..i hope i got that function right..i was just doing it off the top of my head..i hope u get the idea of what i'm trying to do.

well..are there any programs which will convert a C program into assembly language so that I can just program the PIC16F877 in C? i've really cracked my head trying to figure out how to program a recursive function in assembly language. TIA!
 
:wink:

Hi, if you will use C language in conjuction with a PIC, there is some goodie for you on the net. At site below you'll find a free C pic compiler.

https://www.htsoft.com/ named PICC lite

Hopely usefull
Stardus
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…