Searching for code for HCS12 Starter Kit (uses MC9S12E128 CPU)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Searching for code for HCS12 Starter Kit (uses MC9S12E128 CPU)

3,072 Views
SunFish7
Contributor I
 I am sorry to post such basic question.
 
 I have just bought an HCS12 starter kit.   I was using an MSP430  chip but it was unsuitable ( I blew it up - it runs at 3v  and I needed 5v).  so I need to port my code.
 
 there are just a few routines are which architecture specific
 
*  set clock speed to maximum
* microsecond {interval timing & delay} routines
* digital and analogue pin IO routines
* pin interrupt routines ( so as to detect the falling edge of clock line)
* sending/receiving data to/from the host PC
 
for the MSP 430 I was able to find some code on the internet and adapt it.  but I cannot find any code repository for HCS 12 .  please can someone point me in the right direction.
 
at the moment I am stuck... I can run the ADC sample program that comes with the kit, however the sample programme to change the CPU speed does not work as  it should;  I don't want to have to learn the intricacies of the architecture of the chip ( it's too advanced for me ).
 
many thanks,
 
Sam
 
PS  if it is of any interest,   I'm trying to multiplex several PS2  mice.  they are special, so using USB-PS2 converters is impossible. 
Labels (1)
0 Kudos
Reply
4 Replies

1,029 Views
imajeff
Contributor III
Maybe you'd want source for GCC. I've got some stuff and could upload more if I get requests that interrest me. It's just that I haven't retargeted the memory map for the S12E family.
(http://tech.groups.yahoo.com/group/gnu-m68hc11/files)

0 Kudos
Reply

1,029 Views
sabretooth
Contributor I
Good day Sam,
 
I too have come up against some difficulty in getting code for the HCS12.  Not withstanding a large number of code snippets and samples that can be found on the internet, there isn't much available unless you are willing to pay a large amount of money.  To this end, I have written some code that might be able to help you, but first, what type of code are you looking for?  I write code in C, using Imagecraft ICCv7 for CPU12.  If you would like, I can send you a copy of my most recent code to try.  Basically, I have created functions that allow a person to set up several of the modules on-board the HCS12, including the the Clocks and Reset Generator (CRG) on-board an HCS12 (currently my code only supports the DP256 variant, however it can be adapted to other variants of the HCS12).  Using my code, you call several functions to set up the CRG as well as other modules.  Unfortuanately, you will need to have some basic knowledge of how the modules work in order to use my functions properly; I would highly recommend that you look at the "Advance Information" manual for your particular variant of HCS12 to get further insight into the hardware modules you will be using.
 
I wasn't totally correct when I said there isn't much available for code development; there is a company called Feaser that provides some cool-looking products at reasonable prices to assist you with developing drivers for the HCS12.  I haven't tried their products, but you should check them out.  Their website is: http://www.feaser.com/store/bootloader.php
 
I can e-mail you with a copy of my latest code if you like; please let me know.  If you find that the code is useful in any way, and if you are able to create your own projects using this code, please let me know.  My e-mail address is ericnorth101@yahoo.ca.
 
Regards,
Eric
0 Kudos
Reply

1,029 Views
SunFish7
Contributor I
Many thanks for the reply!
 
I have since discovered "processor expert".  this is a brilliant tool for n00bs like me; you click what you want  and it automatically generates the code.
 
Say I want a timer that triggers an interrupt every 2 microseconds... I click on timers,  look down the list until I find the one that generates interrupts, double-click to create one, fiddle the properties to set the interval to 2us, update  the project, and lo and behold it has generated a some nicely commented code that does exactly this.
 
same story for UART, pinIO, CPUspeed, ...
 
I have to say I am surprised that  processor expert  is not accessible with the free version of the software.   it is exactly what a beginner needs to get started.  surely freescale want to encourage beginners to use their kit???
0 Kudos
Reply

1,029 Views
CrasyCat
Specialist III
Hello
 
All simple I/O peripheral beans are available in the Special Edition (free version).
Only Advanced (complex) beans as well as beans you would download from ProcessorExpert web site are not available in that edition.
 
Please refer to the CodeWarrior for HC12 Buyers guide for more information on which beans are available in the special edition.
 
Click here to get access to the CodeWarrior for HC12 Buyers guide.
 
All beans enumerated in the section 3.1.1.2 Basic Beans are available in Special Edition.
 
CrasyCat
0 Kudos
Reply