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,644


    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

  2. #2
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    What i mean is if that numbers corresponds to 8 LATx for example for portA

    For example if we write

    Code:
    LATA = 5
    is that number correspond to binary 8 bit LATA.x , so that number 5 will write only to %00000101 which is the LATA.0 and LATA.2

    Can we write a number then to only one LATA.x

    for example can we write

    Code:
    LATA.0 = 5
    What that number will represent for the LATA.0

    based on the schematic logic gates receive only 0s or 1s. So LATA.x could only get 0s or 1s. Is that right?
    Last edited by astanapane; - 18th August 2020 at 12:04.

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


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    LATA = 5
    replaces the entire contents of lata latch with 5

    LATA.0 = 5

    is a syntax error a bit can only be 0 or 1

    lata.0 is bit 0 of the lata latch
    Warning I'm not a teacher

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Digital touch Screen Combination lock

    lesson 4 bit manipulation need 8 leds attached to porta:0-7

    These four routines [below] march a single lit led across the eight pins of porta from a0 to a7 when inserted in the shell provided.
    try each, which is the best do you think
    one of them could have "issues" @ 64mhz. which one? and why?


    can you reverse the direction of the march for each one ?
    can you light up the leds and march a single unlit led across the eight pins of porta from a0 to a7 ?

    i.
    PORTA.0=1
    WHILE PORTA
    PAUSE 200
    PORTA=PORTA<<1
    WEND
    ii.
    PORTA.0=1
    WHILE PORTA
    PAUSE 200
    PORTA=PORTA*2
    WEND


    iii.
    PORTA.0=1
    PAUSE 200
    PORTA.0=0
    PORTA.1=1
    PAUSE 200
    PORTA.1=0
    PORTA.2=1
    PAUSE 200
    PORTA.2=0
    PORTA.3=1
    PAUSE 200
    PORTA.3=0
    PORTA.4=1
    PAUSE 200
    PORTA.4=0
    PORTA.5=1
    PAUSE 200
    PORTA.5=0
    PORTA.6=1
    PAUSE 200
    PORTA.6=0
    PORTA.7=1
    PAUSE 200
    PORTA.7=0

    iv.
    PORTA=1
    PAUSE 200
    PORTA=2
    PAUSE 200
    PORTA=4
    PAUSE 200
    PORTA=8
    PAUSE 200
    PORTA=16
    PAUSE 200
    PORTA=32
    PAUSE 200
    PORTA=64
    PAUSE 200
    PORTA=128
    PAUSE 200
    PORTA=0

    Code:
    #CONFIG  CONFIG  FOSC=INTIO67, PLLCFG=OFF, PRICLKEN=OFF, FCMEN=OFF, IESO=OFF
      CONFIG  PWRTEN=OFF, BOREN=SBORDIS, BORV=190, WDTEN=ON, WDTPS=32768
      CONFIG  CCP2MX=PORTC1, PBADEN=OFF, CCP3MX=PORTB5, HFOFST=ON, T3CMX=PORTC0
      CONFIG  P2BMX=PORTB5, MCLRE=EXTMCLR, STVREN=ON, LVP=OFF, XINST=OFF, DEBUG=OFF
      CONFIG  CP0=OFF, CP1=OFF, CP2=OFF, CP3=OFF, CPB=OFF, CPD=OFF, WRT0=OFF
      CONFIG  WRT1=OFF, WRT2=OFF, WRT3=OFF, WRTC=OFF, WRTB=OFF, WRTD=OFF, EBTR0=OFF
      CONFIG  EBTR1=OFF, EBTR2=OFF, EBTR3=OFF, EBTRB=OFF
    #ENDCONFIG
    
    
    define  OSC 64 
    OSCCON    = $70   ; 64Mhz
    OSCTUNE.6 =   1     ; Enable 4x PLL
    
    
    
    
    TRISA  = NOT 17 
    ansela = ~ $FF
    
    
    
    
    LOOPY:
        
      ;insert code here
    
    
        PAUSE 3000
    GOTO LOOPY
    Warning I'm not a teacher

  5. #5
    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.

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


    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

  7. #7
    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.

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