Digital touch Screen Combination lock


Closed Thread
Results 1 to 40 of 42

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    excuse me starting from lesson 2.
    First of all as from the configuration, all PORTA is digital with bit 7-2 as input and bit 1-0 to output.


    all PORTA is not digital its all analogue



    now you have given a number to lata = 3. Even if you change this number nothing happen so far.
    the result is fixed , changing the input conditions will never change the result . why ?

    LED 2 is opposite state from porta.1
    no its not its always set. why ?
    and LED 1 the same state as porta.1
    no its not its never set. why ?





    Warning I'm not a teacher

  2. #2
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    Quote Originally Posted by richard View Post
    all PORTA is not digital its all analogue





    the result is fixed , changing the input conditions will never change the result . why ?


    no its not its always set. why ?

    no its not its never set. why ?





    My bad, didint notice

    Code:
    ;ANSELA = 0
    Now things are more confused.

    the result is fixed , changing the input conditions will never change the result . why ?
    Really dont know. It might have to do with the analogue settings on the porta. I made all port digital and response to value changed. But really cant understand the reason.

    Code:
    no its not its always set. why ?
    
    no its not its never set. why ?
    ports configured as analogue by default are read as low?

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


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    ports configured as analogue by default are read as low?

    nearly , pins configured as analogue always read as low
    Warning I'm not a teacher

  4. #4
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    Quote Originally Posted by richard View Post
    nearly , pins configured as analogue always read as low
    these are my notes. I think i will try to understand why these happens.

    What i cannot understand is the writting to the portx or to latx.

    For example if we give alias:

    Code:
    LED1 var LATX
    are we correspond the name to the LATX (not really writting to the LATX)

    So the same applies for the PORTX

    Code:
    LED1 var PORTX
    The problem comes as i understand when we really write to the LATx or PORTx. Values are different.

    I need to do some exercises more on this.

    Name:  20200818_113152.jpg
Views: 16549
Size:  154.0 KB

  5. #5
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    On the diagram above the Flip flop....is it an edge triggered D flip flop?

    If so i will focus on the schematic and i will try to understand what is going on in there.

  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

    On the diagram above the Flip flop....is it an edge triggered D flip flop?
    makes no difference
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    when you write to lata you write directly to the porta output latches, only the pins declared as outputs are connected to the pins via the trisa "switch".
    when you write to porta you write directly to the porta output latches, only the pins declared as outputs are connected to the pins via the trisa "switch".
    when you read porta you read the digital logic level of all the porta pins , analog pins always read low
    when you read lata you read the porta output latches value not the digital logic level of all the porta pins
    when you write to a lata.pin you read the porta output latch value into the alu then,
    logically AND it with that pins bit value as 0 to CLEAR the pin
    or
    logically OR it with that pins bit value as 1 to SET the pin
    then write the result back to the porta output latches

    when you write to a porta.pin you read the porta pins value into the alu then,
    logically AND it with that pins bit value as 0 to CLEAR the pin
    or
    logically OR it with that pins bit value as 1 to SET the pin
    then write the result back to the porta output latches

    if you did lesson one you would have noticed that port pins are subject to real world load conditions and that reading the pin value is not always what you wrote to it
    you need to allow for pin loading

    lesson two shows you can set and clear an analog pin made output but you can never read an analog pin properly

    lesson three shows you can read and write to output latches but they may not represent the pin values of that port they are always what you last wrote to the latch

    Name:  portdiag.png
Views: 16293
Size:  16.9 KB

    the diagram is for 1 pin
    Last edited by richard; - 18th August 2020 at 11:11. Reason: edited to English not gibberish
    Warning I'm not a teacher

  8. #8
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    im trying to understand what is going on with the help of the schematic , in lesson 1.

    Please give me some time.

    I just need to clarify something.

    when you write to all LATA register "0", is that just a number or is a bit? For example if we write

    Code:
    LATA = 5
    Is that a number or is translated to a binary 00000101.

    So this writting to lat register

    Code:
    LATA = 5 
    
    represents the 
    
    LATA = %00000101

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


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    5 dec = 5 hex = bin 101 , numbers are just numbers
    all digital computers to date are binary devices and that's all they can cope with
    programs like pbp C mpasm ...... allow humans to specify numbers in any form we are comfortable with

    generally we have conventions to remove number base confusion
    eg 5 = $5 = 0x05 =%00000101 = 0b00000101= %101 =$05 = %000000000000000101 . the chip only ever sees the binary version
    Warning I'm not a teacher

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