Jump to content
Sign in to follow this  
Msmax

Go with C2C or not?

Recommended Posts

Need your experienced advise.

Working on a project where I need the next to program in a master PIC ( in a multi pic system):

- USART comms with interrupt receive (RS485)

- Soft UART with RB0 interrupt receive (20mA) for 2nd comms port

- I2C bus for local I/O

- ADC with 16 bit calculations

- Set\Clear single pins on ports

- Read single pins on ports

- RELIABLE Packet transfer through USART & soft UART bus

 

As I read through this forum, there are some issues with the C2C compiler. Being a beginner in C-programming, I would like to have your advise to buy C2C for the above project or look for an other compiler.

 

I could program the PIC in assembler, but I really like to learn embedded C. It will make life easier, certainly with 16bit operations.

Share this post


Link to post
Share on other sites

Have you tried Microchip compiler? C2C has some nasty bugs and nobody doesn't seem to fix them. However, most of them can be resolved with workarounds once you encounter them. Other than that, C2C is a great tool for PICs with reasonable price.

Share this post


Link to post
Share on other sites

I'm a real beginner with both pics and c and so far I have managed OK with Picant.

 

It would be nice to have some more of the functionality of the CCS compiler - eg more 'ansi like' but it's OK and the people on this board are a helpful bunch.

 

I'm reaching structures / unions etc in "Learn C in 21 Days" (hahahaha!) so it *may* be problematic but with the plugins now working I have no complaints with this product.  Just to be able to set up the LCD display ( timings are incorrect for real hardware but workable ) and see things on screen prior to programming a pic is a real boon.

 

There should be a section on the Picant site with samples for making it compete with other compilers ( eg use other compilers code ) so all the samples around the net can be easily used in Picant but I have no hesitation in recommending this product.  It's good. ;)

Share this post


Link to post
Share on other sites
Guest Dave

James,

 

Just to be able to set up the LCD display ( timings are incorrect for real hardware but workable )

 

What timings did you find to be different to actual display ???

 

The timings where taken from a data sheet so should be accurate. ;)

 

I can see two reasons that you may find a difference:

1) You have not set the Settings->Clock rate in the IDE. This tells plugins how to relate pic clock cycles to real time (ie allows calculation of how many clock cycles in a 5ms delay for example).

2) Different manufactures displays have slightly varying timing.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Hi Dave,

 

The three I change are PUTCH, CLEAR and POWER UP delays...not such a big deal it's just that they are too fast on the actual hardware and the LCD plugin doesn't like them too slow!!

 

I guess I can do an ifdef but haven't got around to it yet!!

 

All I do is alter the three to program my devboard.  Not really a hassle.

 

Thanks for the info anyway.

 

One quickie you may know though...if I'm trying to receive RS232 data *not* from a MAX232 or whatever but inverted from an opto, am I right to assume that a '0' is true rarther than a '1' in the pragmas?

 

Just thought you may know 'cos the pic isn't reading the data but I can see it on my Fluke oscillascope at 1200 baud and it's driving me nuts!!

 

Just wondered if you knew off your head....

Share this post


Link to post
Share on other sites
Guest Dave

James,

 

Remember that RS232 logic is reverse already,

ie +15V is logic 0 and -15V is logic 1.

 

Regard

Dave

Share this post


Link to post
Share on other sites

Hello,

 

I'm not sure if c2c is the best compiler to learn C or C++, but it is cheap.  I think the ideal situtation is to know C and ASM and then use C2C as a way to speed up your development.

 

If you want to learn C / C++, learn on a fully functional compiler like GNU or Visual C++, and then apply your new-found knowledge to something more platform specific like C2C.

 

-CF

Share this post


Link to post
Share on other sites
Guest Ryan

With 8 years programming embedded controllers of all types and programming windows systems I can say that the C2C and C2C++ compiler for the PIC platform is one of the best I've seen.

 

I've used the mcc18 compiler from Microchip on 18C452 parts and believe me, there are bugs in that compiler too.  To Microchip's credit, their tech support is very very good at responding to questions and creating a work around until the next version compiler.  I've even been able to get through to their software manager for compiler development and he is an extremely knowledgable and helpful guy to deal with.  

 

I've used the PICC compiler from CSC and they are only marginal at performance, have a horrible 16 bit IDE that crashes all the time on a W2K or XP system, and do not follow the C standard very well.

 

C2C++ has a great IDE (comes in a close third behind MPLAB from Microchip and Visual Studio from Microsoft).  C2C++ has some powerful features like add-ins if you like to roll your own and some powerful scripting features.  The C2C++ website could stand a little more professional look and some better examples, especially in C++, but with the forum, there is a multitude of very smart people whos brains you can pick for help.

 

 

My philosophy:

I would not consider any one comiler to be easier to learn than any other one if you are not familiar with C.  From a developer standpoint I would say that once you learn C or C++ you will wonder why you ever spent so many hours of programming in assembly.  I only use assembly in time critical portions of my code for hand crafting the best optimized code.  There is no good reason to use assembly for an entire project over a high level language like C.  Assembly takes longer to write, takes longer to read if you have to jump in the middle of a project, and has only minimally smaller code than C, but who cares because memory is sooo cheap, even in flash parts.  Whether you are a professional getting paid to write code, or a hobbyist, your time is valuable.  Spend it wisely.  Besides, when you learn C you have enough spare time to sit back, favorite cocktail in hand, and watch ST: Enterprise or Stargate: SG1.

Cheers!

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...