element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
NXP Semiconductors
  • Products
  • Manufacturers
  • NXP Semiconductors
  • More
  • Cancel
NXP Semiconductors
Forum RS08 keyboard interrupt
  • Blog
  • Forum
  • Documents
  • Events
  • Quiz
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join NXP Semiconductors to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 1 reply
  • Subscribers 39 subscribers
  • Views 391 views
  • Users 0 members are here
Related

RS08 keyboard interrupt

bluesea
bluesea over 16 years ago

I checked the MC9RS08KA2.pdf but am still not sure about two things:

 

1. When I configure multiple pins as a keyboard interrupt source, how am I supposed to find out which pin did actually cause the interrupt?

From how I got it, I need to poll SIP1_KBI (same for all pins) to find out about an interrupt at all.

What is the recommended best practice after that, just read the value of the port bits, like this:

 

if(PTAD_PTAD0) // Key 0 pressed

...

if(PTAD_PTAD1) // Key 1 pressed

 

or is there  a different method?

 

2. How do I reset the interrupt flag to allow for successive interrupts?

 

Chapter 5.8.6 says (about the SIP1_KBI bit):

"Clearing the KBF flag of the KBISC register clears this bit."

 

Chapter 7.3.1 however states:

"Writes have no effect on KBF." So I assume "KBISC_KBF = 0;" won't work.

 

Then I find:

"Writing a 1 to KBACK is part of the flag-clearing mechanism."

 

This sounds like it would take several steps to really clear the flag, however I can't seem to find a more detailed description of the mentioned "flag-clearing mechanism."

 

So is "KBISC_KBACK = 1;" all there is to do? According to the block diagram this seems fine, but the above quote is somewhat confusing to me.image

  • Sign in to reply
  • Cancel
Parents
  • AlexLuFarnell
    0 AlexLuFarnell over 16 years ago

    imageFirstly, I have no experience with the RS08. These comments are based on S08.

     

    You have to work out which of the enabled KBI pins caused the interrupt yourself.

    Normally you would read the whole port into a variable first and analyse it from there. This avoids the time skew of polling each one individually.

     

    You can poll the flag to find out if a KBI enabled pin has been activated, or you can enable interrupts to interrupt when the flag becomes set.

     

    Writing a 1 to KBACK is all that is required to clear the flag and acknowledge the interrupt.

     

    Hope that helps.image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Reply
  • AlexLuFarnell
    0 AlexLuFarnell over 16 years ago

    imageFirstly, I have no experience with the RS08. These comments are based on S08.

     

    You have to work out which of the enabled KBI pins caused the interrupt yourself.

    Normally you would read the whole port into a variable first and analyse it from there. This avoids the time skew of polling each one individually.

     

    You can poll the flag to find out if a KBI enabled pin has been activated, or you can enable interrupts to interrupt when the flag becomes set.

     

    Writing a 1 to KBACK is all that is required to clear the flag and acknowledge the interrupt.

     

    Hope that helps.image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube