Help me make a counter with MC68HC11

Status
Not open for further replies.

asic1984

Full Member level 5
Joined
Nov 15, 2003
Messages
257
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Visit site
Activity points
2,340
counter code?

hi all

i wanna make an counter with mc68hc11

and display the count in wookie program

i can make it to count till 9 and display it but not for more

if any one have an idea it will be helpful

thanks
 

counter code?

Hi,

I have no expriment with HC11 .

But....
If you don't know how to display number like 3244.

Search for Multiplex Display technique or use shift registers and send your data like 3 then 2 then 4 then 4 .

If you don't know how to count a number greater than 256, search if this microcontroller have a prescaler assign to the counter (if you use the built-in counter) or not.
Second use a 2 8 bit registers to count to 0xffff and so on.

Bye
 

Re: counter code?

hi

first thanks too much for your help

the counter i wanna make suppose to count till 500>250

the mc68hc11 has 2 8-bit registers only A,B

and to display count in the 4 7-segment in the wookie program i need to send data to two 8 bit ports

staa portc,y ; this select the 7-segment location
stab portb,y ; this send the data for the required 7 segment

if i use 2 bytes to save the count .........i will not be able to read it since this is 16 bits and available for me only 8 bits on register 8

how can i come over that ...........noting that i will not implement this code in fact just in the simulator programm

thanks in advance
 

Re: counter code?

hi all

will i found a solution for this problem i used 3 memory location each to hold the number corresponding to one of the 7-segment

thanks too much for your help my brother
 

counter code?

Hi,

العفو

In any uC there are general purpose registers (free address locations) to use them in your process and save the proccessing values.
Example in PIC16F84, The locations from 0xc to 0x7f (i think) are described as general purpose registers.

You can use any of them as follow

CountHigh equ 0x0c
CountLow equ 0x0d

Then you can complete your code by process on CountHigh and CountLow.

I hope that is clear.

Bye
 

Re: counter code?

hi

thanks too much sphinx for your help....جزاك الله خيرا

i have made a code for counting up till 500 and another to count down from the values saved in the 3 memory locations

i need to relate this codes to inturrupts happened in the timer port ic2,ic3

and also generate the inturrupts using the oc2

if any one know how it will be very helpful

thanks too much
 

Re: counter code?

hi

do any one know how to generate inturrupts using the hc11 oc2 pin

i wish that someone know how

thanks in advance
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…