CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC18f4550 programming problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
AbuSaleh



Joined: 09 Dec 2012
Posts: 14

View user's profile Send private message

PIC18f4550 programming problem
PostPosted: Sun Dec 09, 2012 3:50 pm     Reply with quote

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: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Dec 09, 2012 4:29 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Dec 09, 2012 4:40 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 10, 2012 3:02 pm     Reply with quote

Quote:

I don't know how to create a project that combines this code with
the configuration code of PIC184550.

This PDF file shows how to setup a project for the CCS compiler in MPLAB:
http://www.ccsinfo.com/faq.php?page=ccs_mplab
Or, if you have MPLAB-X, see this one:
http://www.ccsinfo.com/pdfs/mplabx_ccs_tutorial.pdf

This thread has examples of the #fuses and #use delay() statements
for an 18F4550:
http://www.ccsinfo.com/forum/viewtopic.php?t=42223
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group