View previous topic :: View next topic |
Author |
Message |
onuruygur
Joined: 17 Jul 2009 Posts: 7
|
18F14K22 RS485 Compile Prob. even with default startup code! |
Posted: Wed Aug 05, 2015 9:07 am |
|
|
Dear all, greetings!
When I just create a new project wizard with the PIC 18F14K22 with RS485 application, the CCS compiler gives consecutive extraordinary errors with the numerous line of RS485.c file.
I tried EX_RS485.C example. It works for PIC16's but not with PIC 18F14K22. Again same problems.
I found a code in the forum, I tried the master code here to see the 18F series compatibility with my compiler version. It compiles fine with 18F46K80 which has also 2 UART and PCH version.
http://www.ccsinfo.com/forum/viewtopic.php?t=53304&highlight=18f+rs485
But when I just change the device:
Code: | #INCLUDE <18F14K22.h> |
again i receive the errors.
I use the CCS v5.007.
i searched the forum for more than 2 hours but couldn't meet any comments related. Do you have any idea?
Thanks in advance for any help! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9241 Location: Greensville,Ontario
|
|
Posted: Wed Aug 05, 2015 4:46 pm |
|
|
You need to check with CCS website to see if that version of the compiler supports that PIC.
If the PIC is newer that the compiler, then obviously the compiler doesn't know it exists and the program will not compile.
V5.007 is very 'old' so I suspect that is why you get the errors.
Jay |
|
|
onuruygur
Joined: 17 Jul 2009 Posts: 7
|
|
Posted: Thu Aug 06, 2015 4:45 am |
|
|
Dear temtronic,
Thank you for your reply. I have download the latest (demo) version from CCS website. But it is same.
On http://www.ccsinfo.com/ccs-tool-selector.php CCS seems compatible with PIC 18F14K22. That's why we were ordered a lot of MCU chips. :(
Here are some screen photos:
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Thu Aug 06, 2015 7:23 am |
|
|
Hmm.
What you post should work.
The supplied code compiles without problems.
Now I wonder about 'other things'. Are your sure that exactly the same project in the same place does compile for other processors?. I'm suspicious that it might be something like language specific delimiters, or expansion of language specific characters in the filename.
Try with the project in a nice simple directory off documents, with no characters in the filename or path involving non ASCII forms.
Similarly try changing your codepage in the OS setup and running temporarily with US English selected.
Problem (unfortunately) is that CCS's error reporting can often report an error that is actually caused by something dozens of lines earlier. It makes a 'best guess', and ploughs on, till it can't cope. I'm very suspicious that it is possibly something much more fundamental, like it can't actually correctly understand a character. Historically CCS will give odd errors for some characters in the filename. It's own parser misunderstands these, so it is suspicious that you have non English characters here.
Looking at it there is an error that may be making the code go bananas. It you select 'USE_EXT_INT', the receive pin _must_ be the external INT pin.
USE_EXTERNAL_INT, is also meant to be defined as TRUE or FALSE. You are defining it without a value. |
|
|
onuruygur
Joined: 17 Jul 2009 Posts: 7
|
|
Posted: Thu Aug 06, 2015 10:33 am |
|
|
Dear temtronic,
Thank you! Your light was right. The wizard define:
Code: | #define RS485_USE_EXT_INT | in the .h file although it is not preffered in the Wizard GUI. And it leaves the definition blank. This is a bug because I was not checked the RS485_USE_EXT_INT.
Just removed the Code: | #define RS485_USE_EXT_INT | definition from the .h file and it compiles.
PS:
if you prefer to use Code: | #define RS485_USE_EXT_INT PIN_C3 | It again gives an error in RS485.c: HW/USART Can not multimaster for Code: | #use rs232(baud=9600, xmit=RS485_TX_PIN, rcv=RS485_RX_PIN, enable=RS485_ENABLE_PIN, bits=9, long_data, multi_master, errors, stream=RS485_CD) |
Thank you again. |
|
|
|