Interfacing DS1216 and MC68HC11

I AM WORKING WITH THE MOTOROLA 68HC11F1.
I AM TRYING TO MAKE A ROUTINE WHICH READS AND WRITES A
DALLAS DS1216C (REAL TIME CLOCK) AND/OR DS1202 SERIAL RTC
BUT UNTIL NOW IT DOESN'T WORK.
I MADE A SIMILAR ROUTINE FOR THE 8031/51 AND IT WORKS FINE.
FIRST I NEED A ROUTINE FOR THE 68HC11.

ShumbaAsked:
Who is Participating?
 
willinoisConnect With a Mentor Commented:
FOR THE 68HC11 routine??????? It's Greek to me I am a hobbyist, but I can search the internet.
**********************************
*         GETKNOB                *
*  GET ENCODE KNOB DIRECTION     *
*  'A' REG HOLD DIRECTION        *
*  1= CLOCKWISE ROTATION         *
*  0= NO ROTATION                *
*  FF= COUNTERCLOCKWISE ROTATION *
*  ADD A TO TO OBJECT TO CHANGE  *
*  IN 8 BIT BLOW OFF CARRY BIT   *
**********************************
GETKNOB  PSHB
         PSHA
         LDAA     PORTE          GET PORT INFO
         ANDA     #$03           MASK OFF ALL BUT ENCODER BITS
         STAA     KNOBTEMP       TEMPORARY STORAGE
         LDAA     KNOBTEMP
         CMPA     KNOBLAST       COMPARE WITH LAST READING
         BEQ      KNOBNONE       NO CHANGE IN KNOB

KNOB00   LDAA     KNOBLAST       GET READINGS
         CMPA     #$00           IS IT "OO"
         BNE      KNOB01         NO TRY NEXT
         LDAA     KNOBTEMP
         CMPA     #$02           IS IT READING BELOW
         BNE      KNOB00H
         LDAA     #$FF           GOING DOWN
         BRA      KNOBDONE
KNOB00H  CMPA     #$01           ARE WE ABOVE
         BNE      KNOB01         NOT HERE(SKIP READ)
         LDAA     #$01           GOING UP
         BRA      KNOBDONE

KNOB01   LDAA     KNOBLAST       GET READINGS
         CMPA     #$01           IS IT "O1"
         BNE      KNOB03         NO TRY NEXT
         LDAA     KNOBTEMP
         CMPA     #$00           IS IT READING BELOW
         BNE      KNOB01H
         LDAA     #$FF           GOING DOWN
         BRA      KNOBDONE
KNOB01H  CMPA     #$03           ARE WE ABOVE
         BNE      KNOB03         NOT HERE(SKIP READ)
         LDAA     #$01           GOING UP
         BRA      KNOBDONE
         
KNOB03   LDAA     KNOBLAST       GET READINGS
         CMPA     #$03           IS IT "03"
         BNE      KNOB02         NO TRY NEXT
         LDAA     KNOBTEMP
         CMPA     #$01           IS IT READING BELOW
         BNE      KNOB03H
         LDAA     #$FF           GOING DOWN
         BRA      KNOBDONE
KNOB03H  CMPA     #$02           ARE WE ABOVE
         BNE      KNOB02         NOT HERE(SKIP READ)
         LDAA     #$01           GOING UP
         BRA      KNOBDONE
         
KNOB02   LDAA     KNOBLAST       GET READINGS
         CMPA     #$02           IS IT "02"
         BNE      KNOBNONE       NO TRY NEXT
         LDAA     KNOBTEMP
         CMPA     #$03           IS IT READING BELOW
         BNE      KNOB02H
         LDAA     #$FF           GOING DOWN
         BRA      KNOBDONE
KNOB02H  CMPA     #$00           ARE WE ABOVE
         BNE      KNOBNONE       NOT HERE(SKIP READ)
         LDAA     #$01           GOING UP
         BRA      KNOBDONE

KNOBDONE STAA     KNOBDIR        STORE KNOB DIRECTION
         LDAA     KNOBTEMP
         STAA     KNOBLAST
         JMP      KNOBOUT        JUMP NEXT COMMAND(SOMEBODY MOVED)

KNOBNONE LDAA     #$00           LOAD NO CHANGE IN KNOB
         STAA     KNOBDIR

KNOBOUT  PULA
         PULB
         RTS
0
 
ShumbaAuthor Commented:
If you get this you must be very smart.
0
 
jhanceCommented:
>>If you get this you must be very smart.

Oh please, this is simple Digital Electronics 101!

What I think is the problem is that YOU have a homework assignment due and don't want to do the work yourself.

Did you realize that it's AGAINST Experts-Exchange policies to ask for someone to do your homework for you?

I'd suggest you try to do the work yourself and then come back and ask for clarification if there is some part of this you don't understand.
0
Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

 
magarityCommented:
"this is simple Digital Electronics 101!"

LOL, it was a lousy day til now; thanks for the laugh.

With 4 or 5 weeks left in the spring semester, it's about the right place in the course to get to something like this.

Perhaps this should be the correct version:
"If you get this you must have paid attention and taken notes"
0
 
magarityCommented:
Furthermore, I find the constant stream of these digital circuit design homework questions pretty insulting.  This one, with its 'you must be very smart' is particularly rude.  Who do these kids think is providing the answers on this board, anyway?  Seems they think we're a bunch of second-year students.  This guy (?) even thinks we're no farther along his class than he is.
0
 
ShumbaAuthor Commented:
Folks I am sorry if I sound rude. Infact this is not an assignment or all that stuff you are thinking of.On the ground Iam trying to get the D1216 to work. I have got some assembly codes that I have written to read the RTC.Let those without positive contributions proceed with their mockery but I am sure that it  proves something..
0
 
ShumbaAuthor Commented:
If anyone thinks its Digital Electronics 101!
or whatever you call it, then they must think again...
0
 
jhanceCommented:
Being an Electrical Engineer and a B.S.E.E. degree, I can assure you that this is indeed Digital Electronics 101 level stuff.

In fact, it's so trivial that it must be homework.  Why?

1) Nobody who has a real job doing this would be challenged by this.

2) Anyone who is qualified to do this kind of work would know exactly where to look if he was not sure how to do it.  (Like the manufacturer's application notes or data sheet.)

3) Nobody who asks such questions could possibly make a living by doing this kind of work.

Now it could be that you are simply a hobbyist playing around with some interesting circuits but your question has nothing in it that indicates this is the case.  In fact, it has all the marks of a homework assignment and a lazy student.  

You state the problem and ask for an answer.  So please understand that nobody here is trying to be difficult but to do your work for you helps out nobody.  If you do graduate someday one of us might have the misfortune of having to work with you and since you didn't do any of your own work in school you'll be a liability...
0
 
ShumbaAuthor Commented:
sorry for that but the problem is still there!
0
 
ShumbaAuthor Commented:
thanx pal.It seems sensible I will try it on my simulator.I will give you the 300 points as you are the only one who had shown positive contribution.

Thanks once again!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.