In order to download the Developer's package you must become a member of the "Developer Connection", which provides you with access to enormous amounts of sample code, a plethora of API's, as well as the definitive reference for all of Apple's available technologies, including the workings of the IPhone. But it's free and easy.
You will need about 3 Gb of free space on a drive, and of course, that does take a while to download, but did I mention, it's free?
Download The Developer's package and Xcode here.
This line indicates the installation was successful, it lists the target microcontroller chip libraries contained in this version.
Ok, now you have a complete embedded C system on your machine. You can use SDCC within the terminal immediately, if you like, but I found the learning curve pretty steep, so, to make things a little more convenient I came up with the next step.
Before you download, You'll need:
Well, the issue is in the name, Small Device C Compiler. Microcontrollers have an extremely small memory space compared to a MacBook Pro. Each targeted chip, while sharing a base of features and commands derived from Intel's 8051, also have individual capabilities that must be coded for specifically. Types can be extremely puzzling due to the constraints of memory: int, long, char, XDATA, IDATA each has special meaning in microcontrollers, in general, but also in each chip. And the basic form of the main function is totally different, in a Mac, the main function comes to an end and returns a value, from which the machine can determine the status of the result, in micros, there is no other machine and the main function is intended to loop for ever.
So the trick is to combine the great convenience and organizing features of Xcode, with the detailed expertise of SDCC. The solution is to use Xcode's special build targets. Xcode offers these configurations as a way to accomplish a wide variety of tasks within Xcode, by utilizing Xcode's extensive battery of environment variables, and the scripting capabilities inherent in the BSD system.
So within the template, there is a makefile configured to call SDCC as the compiler for the specified target file, in each build phase there are scripts which copy or move files so everything lands in the right place. The last script copies the final compiled output file, processes it with a SDCC utility, ipackhx, and delivers it to the loader,a seperate program, which downloads the program to the chip automatically.
You'll find the template is configured to use the EZ-Loader example from the IOKit's USB sample code as the loader, which is specifically for theEZ-USB line of chips from Cypress Semiconductor but it can be easily changed to use any other loader, as long as that loader can be controlled via a bash script.