Shop OBEX P1 Docs P2 Docs Learn Events
Interrupts — Parallax Forums

Interrupts

MacGeek117MacGeek117 Posts: 747
edited 2005-11-19 02:57 in General Discussion
I'm just starting to work with SX/B, and I can't seem to find out how to cause an interrupt by triggering the RTCC pin. Could I please have some help?
RoboGeek

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people in the world,

those that know binary and those that don't.
Formerly bugg.
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com
·

Comments

  • BeanBean Posts: 8,129
    edited 2005-11-17 19:41
    The RTCC pin does not cause an interrupt directly.
    The RTCC register can be configured to count pulses on the RTCC pin.
    When then RTCC register overflows (goes from 255 to 0) that is what causes the interrupt.
    This is configured by using the OPTION register.
    If you truely want a pin to cause an interrupt, you must use one of the RB pins and set it up to generate an interrupt.

    I can't tell you how to do it right off the top of my head because I very rarely use triggered interrupts.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-17 19:42
    I don't believe you quite understand the nature of the RTCC pin, when configured for external counting (step 1), it increments the RTCC counter, if you have also enabled the RTCC interrupt (step 2), the ISR will be called after the RTCC rolls over from 255 to 0. Now if you use the RTIW instruction to return from the ISR you can set the RTCC to a specific value (step 3), meaning you could get it to call the ISR each time the RTCC pin is pulsed. But you must do all three things for that to occur.

    But all of this can be done more straightforward by using interupt on Port B option.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 11/17/2005 7:45:24 PM GMT
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-17 20:26
    Okay, I guess I didn't quite understand the RTCC pin-I'm still just learning. How would you trigger an interrupt using a port B pin?
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 kinds of people in the world,

    those that know binary and those that don't.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-17 20:31
    It's time to hit the books, Bugg.... We have dowloadable resouces that make that stuff clear and forum members shouldn't be forced to read those docs for you. Heck, just open the help file to the INTERRUPT keyword, there are examples right there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-17 23:20
    >>It's time to hit the books, Bugg....<<
    I have many times, mostly with my head. I have·the SX/B·Online Help open·right now-I guess I should tell you something. I don't understand. It's as simple as that. I don't understand. I need to learn. Please, teach me!
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 kinds of people in the world,

    those that know binary and those that don't.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com


    Post Edited (RoboGeek) : 11/17/2005 11:52:31 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-17 23:28
    Just saying you don't understand isn't enough for us to help you, what don't you understand? The user manual is over 100 pages long, you want us to explain the entire thing to you? Be specific, point to the exact page and paragraph and even sentence of the document that you don't understand.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-17 23:39
    SX/B Online Help>>Interrupt>>Asyncronous Interrupts. how do I set the neccessary bits in WKED_B, WKEN_B, and WKPND_B registers?
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 kinds of people in the world,

    those that know binary and those that don't.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
    ·
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-17 23:50
    Do I just WKEN.x = 0~1?
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 kinds of people in the world,

    those that know binary and those that don't.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-18 00:08
    Read http://www.parallax.com/dl/docs/books/ExploringTheSx.pdf
    starting on page 108 (page 118 of the pdf), pay attention to the code presented on page 112 and 113 (122 & 123 of pdf), you'll see they are dealt with bytewise (ie WKED_B=$FF WKPND_B=0 etc.).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-18 01:54
    Would something like this ever work for detecting pulses on the RTCC pin? (Sorry, don't have an SX yet.) It assembles quite nicely.
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 kinds of people in the world,

    those that know binary and those that don't.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
  • BeanBean Posts: 8,129
    edited 2005-11-18 02:56
    Bugg,
    Seriously, your wasting your time (and ours) asking if a program works, when you don't have any hardware.
    It's like trying to teach someone to drive without a car.
    I would read the WHOLE manual, then read the WHOLE datasheet, then read the entire SX/B help file, then go back and re-read everything again.
    I'm being serious. I bet I've read the SX-Key manual 12 times or more, pretty much cover to cover. And everytime a little more of it sticks inside my brain.
    That way when you do get hardware you will be ready to start cranking out the code.
    If you have questions about the SX documentation please ask away.

    I'm not trying to discourage you, I can tell your really into this stuff, but there is alot of info in those documents, and reading them is not time wasted.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-18 04:59
    Im not going to come down on you hard Bugg, I know you don't have the money right now to invest in the SX tools, I too am experiencing a fiscal crunch at the moment (had to ask for my Christmas gift from the parents to be airline tickets for me and my girlfriend to visit them on Thanksgiving). But you do have a tool to test out your programs without the hardware, the SX Simulator. Gunther did a great job on it and it is now integrated with the IDE, I dont know if he has it set up to receive an external datafile to simulate inputs on the RTCC, but you can set it up to run internally and see if the program behaves the way you expected it to. Also if you ask him nicely (be sure it doesn't already have the ability first) you can ask him to add the feature in the sticky post in this forum, good luck.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-18 15:32
    Thank you for all the help you've given me-I do appreciate it. The SXSim........not working. The Commands part of the program won't open. If I understand correctly, the RTCC pin is active-high, right?
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are·3 kinds of people in the world,

    the dreamers, the do-ers, and the "Oh, what's this button do"-ers.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-18 15:40
    Your running a Win98 machine aren't you, I don't know if that is why you are having difficulties with running SXSim or not. I believe the RTCC is incremented each time the pin goes high.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-11-18 16:33
    The nice thing with the SX controllers is that you can configure it a lot. This is also true for the RTCC input pin. The RTE_ES bit (bit 4) in the OPTION register selects which signal edge shall on the RTCC input shall cause RTCC to increment: 0 = falling (negative) edge, 1 = rising (positive) edge. Please note that the RTCC will only increment on transitions on the RTCC pin, when the RTS bit (bit 5) in OPTION is set. In addition, an RTCC rollover will trigger an interrupt only, when OPTION bit RTE_IE (bit 6) is clear. In addition, you can assign the internal prescaler to the RTCC input pin. To do this, clear the PSA bit (bit 3) in the OPTION register, and setup bits 0...2 for the desired dividy-by factor.

    You can find this information in the SX28 datasheet on page 12.

    Now, concerning your trouble with SXSim, I have no idea what happens to the "Commands" window. When you simulate a list file, say "TEST.LST", and exit SXSim, or select another LIST file, SXSim saves important session data in a *.SIM file (TEST.SIM in this case), including the positions and sizes of the various windows. Maybe, the position information for the Commands window in the SIM file got corrupted by some reason, causing the Commands window beeing positioned somewhere outside your screen resolution. Simply delete the SIM files, and give it another try. Without a matching SIM file, SXSim will reset to the defaults, including the position of the Commands window. Please let me know if this works for you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-19 00:45
    No dice. Uninstall, reinstall. Nada.freaked.gif BTW, looked at the docs, couldn't quite figure it out. I'm straightened out now. Thank you!

    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are·3 kinds of people in the world,

    the dreamers, the do-ers, and the "Oh, what's this button do"-ers.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com


    Post Edited (RoboGeek) : 11/19/2005 12:50:05 AM GMT
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-19 01:39
    I just installed the SX-Key software on the XP machine and it works wonderfully! Thank you!
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are·3 kinds of people in the world,

    the dreamers, the do-ers, and the "Oh, what's this button do"-ers.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-19 02:57
    Good news -- now put it to use while you're waiting on your SX hardware.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.