Any MC9S08QG8 Assembly Language Code Examples out there?

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

Any MC9S08QG8 Assembly Language Code Examples out there?

2,459 Views
Balok
Contributor I
Hi All,
This is my first post, and my first opportunity to use a MOT / FreeScale processor in many years. I purchased a DEMO9s08qg8 demo board & got CodeWarrior up & running. The only code examples I've been able to find are in C. My application is very simple and time is short. What I'd really like to find are some example programs for the demo board written in assembler. Anybody know where to look?

Thanks in advance,
Balok
Labels (1)
0 Kudos
Reply
4 Replies

621 Views
bigmac
Specialist III
Hello Balok,
 
Have a look in your CW directory, at ... \CodeWarrior_Examples\Hcs08\Assembly Examples.
 
Regards,
Mac
 
0 Kudos
Reply

621 Views
Balok
Contributor I
Hi Mac,

Yeah, I saw that one. On my CD, there's only one timer skeleton example. I was hoping to find something with a little more meat, using that demo board. The application is quite simple. The hardware applies power to the micro when a key is pressed. The micro then grabs the power control pin, reads which key was hit & holds itself on until the selected task is complete.
I'll definately have to brush up on "C" eventually, but for this app? It's gotta be done by the end of next week.

Thanks for the info,
Balok
0 Kudos
Reply

621 Views
bigmac
Specialist III
Hello Balok,
 
You may find a little more variation in the CW examples given for the various HC08 devices.  While not directly applicable to your board, they can probably be easily adaped - some of the labels associated the peripheral registers may differ slightly.
 
Your immediate problem sounds quite simple.  Since you are using external hardware to switch power to the device, you don't have to worry about the use of any of the stop modes.  Do any of your tasks require non-volatile data to be stored in flash?  I presume that you are using separate inputs for each key (not a matrix key pad) in order to implement the power control.
 
I did something like this a couple of years ago, using one of the HC08 devices.  In this case, the project ran off a couple of lithium cells.
 
Regards,
Mac
 
 
0 Kudos
Reply

621 Views
Balok
Contributor I
Yes, the application is really easy functionally. Battery power saving and output pulse timing is critical. I'm trying to figure out how to enable a few peripherals, and disable all the rest. Right now, I think I'll read the input keys when power comes on, look up the bit string to output, and send 'em out with either the UART, or bang 'em out with a port pin, timed by the timer. Somewhere I'll check for low-battery and enable the watchdog to shut things off if it hangs. Then I'll shut off power & wait for the next power-on.
I was hoping to find some code to shut everything else off. The receiver is looking for a 24-bit NRZ code, at 500 uSec per bit. I wish to try the internal oscillator to produce this timing. If it can't hold the timing accuracy over temperature and battery voltage variations, I'll have to go crystal.
All in all, it looks like a good project to get my feet wet with the 9S08.
Any insights welcomed & appreciated.
Thanks,
Balok
0 Kudos
Reply