ALP for Real Time Clock using timer unit of HC12

HI,

I am implementing an ALP program to implement a real time clock to display hour,minute,second using features available in a timer unit. Digits have to displayed on one of the GPIO ports of HC12 micro-controller.

I do know how to proceed on this in C language but am a newbie in micro-controllers and assembly programming - was hoping that someone could point me in the right direction -- perhaps even coded examples that could serve as a way to better understand it.

Thank you in advance!

--------------------------------------- This message was sent using the comp.arch.embedded web interface on

formatting link

Reply to
alex99
Loading thread data ...

First, just as you learned the elements of the "C" language, you will need to learn the elements of "HC12 Assembler"; new language, new words and punctuation. Find a good book.

The HC12 has been around for a while, and while I'm not familiar with any particular writer, I'm sure many HC12 books have been written. Start with your local library, your local college library, or even Amazon.com's used book section.

Another route would be to dig up a copy of the HC12 architecture and instruction set. Even if you can't locate this (these) at an official Motorola/Freescale site, there should be many old copies running around on the 'web.

Second, start by coding your solution in C, then locate an HC12 cross-compiler (e.g. gcc) and generate an HC12 pseudoassembler listing from it. With this listing in front of you, and the HC12 instruction set descrioption handy, work your way through how what you asked for in C "looks" to the HC12 processor.

The rest is up to you. You have indicated that you know how to proceed with C, so I won't go into details like what port pins do what, but you'll still need to know how to take your assembler text file and create an executable image file from it, and how to get that image loaded into your HC12.

Hope this helps...

Frank McKenney

--
  The thing which keeps life romantic and full of fiery possibilities
  is the existence of these great plain limitations which force all
 Click to see the full signature
Reply to
Frnak McKenney

display

to

could

could

Tank you. The C solution I have in mind is what I found on another thread here:

if (RTC_tick>= XX ){ seconds++; RTC_tick = 0;

if (seconds>=60){ minutes++; seconds = 0; } if (minutes>=60){ hours++; minutes = 0; } if (hours>=24){ days++; hours = 0; } }

Will this be enough to run on a simulator?

--------------------------------------- This message was sent using the comp.arch.embedded web interface on

formatting link

Reply to
alex99

Try: RTC_tick -= XX;

Reply to
Nobody

ad

Why?

Bye Jack

Reply to
Jack

read

ah, ok. Understood. a little bit slow today :P

Bye Jack

Reply to
Jack

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.