Can anyone help me to get the Sample source to compile so that I can test my PCB. I have downloaded the example a week ago and I am using CC5X and Jens Editor to try to compile the code. I get many errors! I fix one get another any help would be greatly appreciated.
I have never used CC5X and I think the problem is with the setup. I have followed the tutorial on the Sparkfun website to setup the compiler and assembler but nothing works.
The first problem was with the stdio file which did not come with the CC5X download.
Check out that posting; I’m not sure specifically which errors are occurring, but I had to modify the code to get it to compile. The reason for the error is most likely that you’re using the free version and the sample code uses the non-free version, which doesn’t have the same limitations.
Thanks for the reply! I will add the changes for CC5X free version. I do not think the problem is that. See my compiler errors:
[F:\cc5x\Cc5x.exe F:\CC5X\rf-24g-example.c -ew
CC5X Version 3.2A, Copyright (c) B Knudsen Data, Norway 1992-2004
--> FREE edition, 8-16 bit int, 24 bit float, 1k code, reduced optim.
F:\CC5X\rf-24g-example.c:
int counter;
^------
Error F:\CC5X\Stdio.c 40: Type mismatch in redeclaration of 'counter'
(The variable identifier have been declared earlier using another type)
}
^------
Error F:\CC5X\Stdio.c 441: Function needs return
(Functions that are not 'void' need a return at the end of the function)
Warning F:\CC5X\rf-24g-example.c 77: Duplicate declaration of 'counter'
void main()
{
^------
Error F:\CC5X\rf-24g-example.c 86: Duplicate definition of function 'main'
(The same function identifier is used for another function)
{
OSCCON = 0b.0111.0000; //Setup internal oscillator for 8MHz
^------
Error F:\CC5X\rf-24g-example.c 131: Symbol 'OSCCON' is undefined
(The definition of the symbol in not known. This can be due to
wrong spelling or letter case mismatch. Otherwise a new symbol
definition is required: variable, function, macro, etc.)
ANSEL = 0b.0000.0000; //Turn pins to Digital instead of Analog
^------
Error F:\CC5X\rf-24g-example.c 134: Symbol 'ANSEL' is undefined
ANSEL = 0b.0000.0000; //Turn pins to Digital instead of Analog
CMCON = 0b.0000.0111; //Turn off comparator on RA port
^------
Error F:\CC5X\rf-24g-example.c 135: Symbol 'CMCON' is undefined]
I’ve seen all those errors; I just need to try and remember what causes them…
One of the .C files had a ‘main’ function in it that was used for testing; you can take that out and any variables declared that are used within that main function. I think the ‘counter’ one is declared in the same function that uses the main; see if you can get rid of those and I think it will fix half of the errors.
The OSCON, ANSEL, etc things not being defined is b/c the header file for your chip doesn’t appear to be included. Put #include “16f88.h” at the top and see if that fixes it. If it’s already there, I’d have to think about it.
THere’s nothing impossibly complex; just has to be tweaked to get it to work.