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

watchdog

dbjdbj Posts: 75
edited 2006-12-12 12:22 in General Discussion
Does any one have any advice on using the sleep command with the SX28 , I am using it to control a door lock and scan a keypad, want to put it to sleep and wake it up using·the # key to wake up. Gunther Daubach says that you must use the RB I/0 in order· pull-down the·I/0 pin, does it mater which·pin you use?·I'm not to clear on how the resistors are configured·1k and 10k· the 1k should go to Rb0 and then to VSS ? but if the rows are not being scanned how does this wake up the SX, also can you use the·watchdog timmer with the sleep command, Thanks David



····················································· ········

Comments

  • BeanBean Posts: 8,129
    edited 2006-12-10 22:47
    David,
    The SX can be configured to wake-up when any of the RB pins change state and/or when the watchdog timer times out.
    You would need to setup the rows so that when the "#" key is pressed the state changes on one of the RB Pins.
    OR you could use the watchdog to wakeup the SX and then scan the keys and determine if the "#" is pressed.

    The first method would be the most straight forward and conserve the most power.


    Without a schematic I cannot comment on you other questions.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
    ·
  • dbjdbj Posts: 75
    edited 2006-12-11 06:16
    This is What I think it should look like , is it ok to have all them on the RB I/O pins all of the demo's show them on the RC I/O pins I dont use the RC4 pin but I do need it for an output , how do I make it avalible , it is being used buy the SX28just like in the demo. I dont have enough I/O pins, have thought about using a philips LPC2103 that uses Ic2 which uses 2 pins insted of three like the ds1302 and it does the days of the year julin within the chip. How hard is it to talk to these devices over the Ic2 bus? do you know of any examples? Thanks David

    Keys··········· VAR···· RB····················· ' keyboard scan port
    TRIS_Keys······ VAR···· TRIS_B
    PLP_Keys······· VAR···· PLP_B
    Col1··········· VAR···· Keys.7················· ' column inputs
    Col2··········· VAR···· Keys.6
    Col3··········· VAR···· Keys.5
    Col4··········· VAR···· Keys.4

    tmpB1 = 0···································· ' reset keyboard value
    · Keys = %0000_0111······················ ' activate first row
    · TRIS_Keys = %1111_0000··············· ' refresh IO state
    · PLP_Keys = %0000_1111················· ' pull-up input pins

    Post Edited (dbj) : 12/12/2006 12:20:32 PM GMT
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-12-11 07:40
    Wow!
    I finally understand why all the RB pins do wake up.
    I had never thought that a matrix keyboard would be involved.

    With 8 bits one could actually do 8X8 or 64 keys at maximum.

    I seem to have been thinking I only needed one bit unless I was trying to do some complex robotic scheme.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • dbjdbj Posts: 75
    edited 2006-12-12 12:22
    Here is what I think is the correct way to connect.
    ······················································· David
Sign In or Register to comment.