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

    lesson 2

    what happens here and why ? does changing the lata initial value make a difference?

    Code:
    #CONFIG  CONFIG  FOSC = INTIO67
      CONFIG  PLLCFG = OFF
      CONFIG  PRICLKEN = ON
      CONFIG  FCMEN = OFF
      CONFIG  IESO = OFF
      CONFIG  PWRTEN = ON
      CONFIG  BOREN = SBORDIS
      CONFIG  BORV = 190
      CONFIG  WDTEN = ON
      CONFIG  WDTPS = 32768
      CONFIG  CCP2MX = PORTC1
      CONFIG  PBADEN = OFF
      CONFIG  CCP3MX = PORTB5                                
      CONFIG  T3CMX = PORTC0
      CONFIG  HFOFST = ON
      CONFIG  P2BMX = PORTB5
      CONFIG  MCLRE = EXTMCLR
      CONFIG  STVREN = ON
      CONFIG  LVP = OFF
      CONFIG  XINST = OFF
      CONFIG  DEBUG = OFF
      CONFIG  CP0 = OFF
      CONFIG  CP1 = OFF
      CONFIG  CP2 = OFF
      CONFIG  CP3 = OFF
      CONFIG  CPB = OFF
      CONFIG  CPD = OFF
      CONFIG  WRT0 = OFF
      CONFIG  WRT1 = OFF
      CONFIG  WRT2 = OFF
      CONFIG  WRT3 = OFF
      CONFIG  WRTC = OFF
      CONFIG  WRTB = OFF
      CONFIG  WRTD = OFF
      CONFIG  EBTR0 = OFF
      CONFIG  EBTR1 = OFF
      CONFIG  EBTR2 = OFF
      CONFIG  EBTR3 = OFF
      CONFIG  EBTRB = OFF
    #ENDCONFIG
    '    DEFINE DEBUG_REG PORTB
    '    DEFINE DEBUG_BIT 7      ;  if not used for pwr  
    '    DEFINE DEBUG_BAUD 9600
    '    DEFINE DEBUG_MODE 0  
    '  ASM
    
    
    
    
        ;ANSELA = 0
        DEFINE OSC 64 
        OSCCON = $70
        OSCTUNE.6 = 1
        TRISA = %11111100 
    led1 var lata.0
    led2 var lata.1
    
    
    loopy:
    lata=3   ;init porta
    led2 = !porta.1
    
    
    led1 = porta.1
    
    
    pause 3000
     
    goto loopy
    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
    lesson 2

    what happens here and why ? does changing the lata initial value make a difference?

    Code:
    #CONFIG  CONFIG  FOSC = INTIO67
      CONFIG  PLLCFG = OFF
      CONFIG  PRICLKEN = ON
      CONFIG  FCMEN = OFF
      CONFIG  IESO = OFF
      CONFIG  PWRTEN = ON
      CONFIG  BOREN = SBORDIS
      CONFIG  BORV = 190
      CONFIG  WDTEN = ON
      CONFIG  WDTPS = 32768
      CONFIG  CCP2MX = PORTC1
      CONFIG  PBADEN = OFF
      CONFIG  CCP3MX = PORTB5                                
      CONFIG  T3CMX = PORTC0
      CONFIG  HFOFST = ON
      CONFIG  P2BMX = PORTB5
      CONFIG  MCLRE = EXTMCLR
      CONFIG  STVREN = ON
      CONFIG  LVP = OFF
      CONFIG  XINST = OFF
      CONFIG  DEBUG = OFF
      CONFIG  CP0 = OFF
      CONFIG  CP1 = OFF
      CONFIG  CP2 = OFF
      CONFIG  CP3 = OFF
      CONFIG  CPB = OFF
      CONFIG  CPD = OFF
      CONFIG  WRT0 = OFF
      CONFIG  WRT1 = OFF
      CONFIG  WRT2 = OFF
      CONFIG  WRT3 = OFF
      CONFIG  WRTC = OFF
      CONFIG  WRTB = OFF
      CONFIG  WRTD = OFF
      CONFIG  EBTR0 = OFF
      CONFIG  EBTR1 = OFF
      CONFIG  EBTR2 = OFF
      CONFIG  EBTR3 = OFF
      CONFIG  EBTRB = OFF
    #ENDCONFIG
    '    DEFINE DEBUG_REG PORTB
    '    DEFINE DEBUG_BIT 7      ;  if not used for pwr  
    '    DEFINE DEBUG_BAUD 9600
    '    DEFINE DEBUG_MODE 0  
    '  ASM
    
    
    
    
        ;ANSELA = 0
        DEFINE OSC 64 
        OSCCON = $70
        OSCTUNE.6 = 1
        TRISA = %11111100 
    led1 var lata.0
    led2 var lata.1
    
    
    loopy:
    lata=3   ;init porta
    led2 = !porta.1
    
    
    led1 = porta.1
    
    
    pause 3000
     
    goto loopy
    excuse me starting from lesson 2.

    Name:  not porta1.png
Views: 16520
Size:  447.5 KB

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

    now you have given a number to lata = 3. Even if you change this number nothing happen so far.

    LED 2 is opossite state from porta.1

    and LED 1 the same state as porta.1

    We havent configured any port to high or low. By default the ports are set to low?

    Could you also explain what is the logic behind the LATA.

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