View previous topic :: View next topic |
Author |
Message |
AbuSaleh
Joined: 09 Dec 2012 Posts: 14
|
PIC18f4550 programming problem |
Posted: Sun Dec 09, 2012 3:50 pm |
|
|
I used Simulink software to design a fuzzy logic controller. After that I used the Simulink built-in tool to generate C code from this model. I used Bloodshed software to compile and evaluate the generated code and it worked correctly but in Windows environment. Now I want to use CCS compiler with MPLAB to compile and program a PIC18f4550 microcontroller with this code but I don't know how to create a project that combines this code with the configuration code of PIC184550.
Thanks in advance. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Sun Dec 09, 2012 4:29 pm |
|
|
Fuzzy ??? Man I thought that died years ago....
Long story short, you will not be able to easily 'port over' your code to CCS C.
There's probably a lot of functions and 'structure' issues and a quick look at 'Bloodshed opens up another 'can of worms'.
Fuzzy logic really consists of a huge number of if-then-else statements and Microchip themselves had a fuzzy logic compiler but again CCS C is not 'fuzzy', it's also NOT C+,C++,VC,etc.
It is, however, possible to cut CCS C code that will run similar to 'fuzzy', it's just going to take you a lot of time and effort to 'port' the fuzzy code into something equivalent in CCS C.
Depending on your talent level, controller demands, time available it is possible.
You might try 'googling CCS C fuzzy' and see what comes up ??
hth
jay |
|
|
AbuSaleh
Joined: 09 Dec 2012 Posts: 14
|
|
Posted: Sun Dec 09, 2012 4:40 pm |
|
|
but I have already generated C code. I used Bloodshed just to check the generated ANSI C code, and now I want to compile this already C code using CCS, that mean I deal with C code not with fuzzy controller because it has already changed into C code. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|