|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionI do some C programming for PIC microcontrollers at work. Some time ago, I developed a "PIC" C AppWizard (under MS-Visual Studio v6) to create C PIC applications. Now I've decided to make it a Win32 "regular" executable so the wizard does not depend on Visual Studio IDE. This PIC-C Wizard creates C code templates to be used for certain Microchip (tm) PIC microcontrollers using the Hi-Tech's PICC compiler (tm). I know these two issues limit the usability of the tool, so I hope someone finds it useful. The demo files provided are part of a demo PIC C project created using this wizard. Features
To be honest, all these features are not yet implemented 100% and the wizard may still be "buggy". I'll be posting frequent updates as I'm still working on it. InstallI have not yet created an installer for this tool. So for now, simply download it and place it under a folder of your choice. I have tested it under Windows XP, 2K and NT SP6. How This Wizard WorksUser's folder and default C template filesThe wizard will create a folder under the wizard's root folder. This folder
will be named: The user can modify these C templates and the wizard will just replace the macros contained in them. This is a list of the files generated by the wizard: Common to both PIC and PC:
For PIC compilation:
For PC compilation:
You may be wondering, why is there a Win32 version of an application that is supposed to go into an 8-bit micro? Because the idea was to debug the application, to some extent, before actually downloading the zeros and ones into the micro. The idea made some sense to me before, as it's easier to debug under VC. But quickly I learned that I lack the time and knowledge to simulate the PIC's peripherals. Well, at least it helps me to debug certain applications using floating-point based algorithms. How does the wizard create a PIC application?Since I've used the Visual C/C++ AppWizard several times, my brain could not think of another good way to implement one, but to imitate the way MS-VC does it. Of course my implementation falls short compared to the real one but I think it does the job. So this wizard basically looks for special words, called macros, in all the template files and replace them with values provided by the user through the GUI interface. One clear advantage of this wizard is that the C templates are open for the user to modify. It makes sense, I mean, I provided these C default templates, which only reflects my limited experience in C programming; good enough for the novice user though. But for the expert, mmh, let's better have another look at that code. Now, for someone to start modifying the default templates, it's necessary to know all the available macros and I'll include them in this article in the very near future. Can the source code be modified to have another wizard?Short answer is yes. Soon I'll provide more information on what and how to modify the source code provided to have another wizard. How To UseA tutorial will be coming soon... Revision History
AcknowledgmentsWhat? You really think that the only cool things about the wizard were programmed by me? Of course not, I really must thank these guys for their great code:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||