I was originally going to write my program in ASM, but after a suggestion, I wrote a function in C that I want to use in my ASM code since it was supposed to make things a little easier.
However, I am having trouble linking the two together, and I'd like a little help. First of all, I am using MPLAB. First I tried to put the two source codes together, but MPLAB won't allow me. So I tried to compile the C code separately (using the default C linker file) then I added the object file to my main project. So far, I've been trying to compile this, but I am still having problems.
This is one error I cannot figure out. "Error - could not find definition of symbol 'FSR2L' in file 'C:\Program Files\Microchip\MPASM Suite\440\project1\Test\temperature.o'."
The funny thing is, I don't even use this variable. I even do an #include P18F4450.h" at the top of the .c file, so I'm not really sure what the problem is.
Anyways, attached is my C code, and below is how I call it in my .asm file:
Let me know if there's any other information I can give while I bang my head against my desk trying to figure this out.
However, I am having trouble linking the two together, and I'd like a little help. First of all, I am using MPLAB. First I tried to put the two source codes together, but MPLAB won't allow me. So I tried to compile the C code separately (using the default C linker file) then I added the object file to my main project. So far, I've been trying to compile this, but I am still having problems.
This is one error I cannot figure out. "Error - could not find definition of symbol 'FSR2L' in file 'C:\Program Files\Microchip\MPASM Suite\440\project1\Test\temperature.o'."
The funny thing is, I don't even use this variable. I even do an #include P18F4450.h" at the top of the .c file, so I'm not really sure what the problem is.
Anyways, attached is my C code, and below is how I call it in my .asm file:
Rich (BB code):
...
VOLTS_2 res 1 ; My "display" variables
VOLTS_3 res 1
VOLTS_4 res 1
...
extern ad_to_volts
....
temp:
...
call ad_to_volts ; converts ADRESH/ADRESL into volts, puts data into
; "VOLTS" variables
...