Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/13/11 12:31
Read: times


 
#182625 - Timers/LCD and Interrupts problem
Hello,

I have connected 2x16 LCD to P0 with pull-up resistors. I have a button to simulate an interrupt connected to INT0.
RW -> P1.1, RS -> P1.2, E -> P1.3 respectively.

At ports P1.0, P1.1. P1.2 I have connected A0, A1, A2 of 74HC138 and 5 buttons that connect to P2.7

This is by design and cannot be changed. Now I have to use this design and to write a relatively simple program that counts pulses from the interrupt, displays them on the LCD and changes between several screens (menu). Nothing special. That's a real world taxi meter.
I have to emulate part of its functionality. I use Proteus to do the simulation as I do not have access to the hardware.

So far almost everything is OK. I have trouble testing the Busy Flag but I use timer delay (in ms & sec) instead. I have yet to implement the keyboard.

PROBLEM: Here comes my problem - the interrupts! It appears that the interrupt messes with the timer and causes a crash.
It also appears that if I press the button to simulate an interrupt the MCU get lots and lots of interrupts.
Here I'm stuck. I have no idea how to handle this interrupt problem and why should I have a problem with the timer delay? The timer delay subroutine tests for overflow and does not use an interrupt.

Any ideas how to handle these problems? The tutorial doesn't give me enough information or I cannot understand it properly.

BTW. This is my first assembly/8051 project ever. It's interesting but a little bit overwhelming at times.

If necessary I can post my files too.

Thank you very much in advance!

List of 12 messages in thread
TopicAuthorDate
Timers/LCD and Interrupts problem            01/01/70 00:00      
   show sourcecode and BTW...            01/01/70 00:00      
      thanks            01/01/70 00:00      
         Using Google Documents....arrrgh.            01/01/70 00:00      
            I hope that's better            01/01/70 00:00      
   Button Connect to Interrupt :-(            01/01/70 00:00      
      but it can be good exercise            01/01/70 00:00      
         hmmm            01/01/70 00:00      
            irq pin            01/01/70 00:00      
               simulator            01/01/70 00:00      
                  push pop            01/01/70 00:00      
                     :(            01/01/70 00:00      

Back to Subject List