Digital touch Screen Combination lock


Closed Thread
Results 1 to 40 of 42

Hybrid View

  1. #1
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    im still in lesson 1.



    i need to completely understand it with the use of the port schmeatic.

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,651


    Did you find this post helpful? Yes | No

    Angry Re: Digital touch Screen Combination lock

    make lesson 1 loop like this and try with and without the nop

    Code:
    loopy:
    lata=2
    pause 10
    porta.1 = 0
    ;@ nop
    porta.0 = 1
    
    
    
    
    pause 1000
     
    goto loopy
    the secret is that leds when forward biased charge up , when you set them low the charge can hold the pin high long enough
    to trigger a rmw event on a fast chip. the nop allows enough time for the charge to dissipate {62 nano seconds}
    Last edited by richard; - 18th August 2020 at 13:54.
    Warning I'm not a teacher

  3. #3
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    one by one,

    i'm doing some test. Really i have my own way to catch up and understand things.

    first of all for lata we can only write up to 255 as it is 8 bit.

    I'm still figuring out step by step the diagram.

  4. #4
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    this is really helpful for me as well.

    https://download.mikroe.com/document...c/help/rmw.htm

  5. #5
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    ok i think i have some how understood the concept.

    my question is.

    How could we assign a value that can be stored in memory and represent the state of the pin itself. (0 or 1)

    but at the same time to not read the actual pin, but the value that is stored in memory.

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,651


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    How could we assign a value that can be stored in memory and represent the state of the pin itself. (0 or 1)


    but at the same time to not read the actual pin, but the value that is stored in memory.
    simple, to read the value assigned to pins designated as output read latx its value is always what you last set it to
    the latx value of pins set as input is meaningless in regards to actual pin logic level

    to read the actual pin logic levels at a point in time read portx , its always the actual pin value at read time

    pin and latx values are not necessarily equal at a point in time, pins set as output are subject to real world physical constraints dictated by the load impedance they are driving
    Warning I'm not a teacher

  7. #7
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    i did a small test but it is not what i need.

    I would like now once again to clear the following.

    Henrik said

    "One more thing: You're clearly reading PORTB which must mean you're using those five low bits as inputs, yet, at the top of the program you have TRISB = %00000000 which makes all of PORTB outputs..."
    As this statement, how could we read the status of the actual pin without using the port as input. Could you please explain to me the method?

    Code:
    ANSELA = 0
        DEFINE OSC 64 
        OSCCON = $70
        OSCTUNE.6 = 1
        TRISA = %11111100 
                                 
    led1 var porta.0    ; alias led1 to porta.0
    led2 var porta.1    ; alias led2 to porta.1
    x    var bit            ; tried to use X var as a bit in order to hold the value of the actual status of the pin.
    
    lata = 0               ; based on the schematic, we write to LATA and clear the ports 
    
    x = 0                  ; we write 0 to var X
    
    
    loopy:
    lata.0 = 1           ; we write 1 to lata.0
    gosub holdmem  ; gosub to holdmem
    
    pause 500
    read 5,led2        ; write the value of the location 5 to led2
    
    pause 500
    lata.0 = x          ; write the value of X to lata.0
    lata.1 = x          ; write the value of X to lala.1
    
    pause 1000
    goto loopy
    
    holdmem:
    write 5,led1  ; read the state of the porta.0 and place it to location 5 in memory.
    return

Similar Threads

  1. 4 Wire resistive touch screen, Need help
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 16th February 2012, 17:28
  2. combination lock
    By korayfethi in forum Schematics
    Replies: 13
    Last Post: - 23rd May 2007, 20:02
  3. Round Dial, Electronic Combination Lock
    By Pic_User in forum Off Topic
    Replies: 5
    Last Post: - 6th July 2006, 13:34
  4. touch screen
    By micro in forum General
    Replies: 1
    Last Post: - 13th January 2006, 03:39
  5. Touch Screen Wish List!!!
    By Amity in forum PBP Wish List
    Replies: 2
    Last Post: - 15th September 2005, 14:40

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts