16F690 read/write


Closed Thread
Results 1 to 14 of 14

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: 16F690 read/write

    this is what I tried , it works fine


    Code:
    #CONFIG
    cfg = _INTRC_OSC_NOCLKOUT
    cfg&= _WDT_ON
    cfg&= _PWRTE_OFF
    cfg&= _MCLRE_ON
    cfg&= _CP_OFF
    cfg&= _CPD_OFF
    cfg&= _BOD_ON
    cfg&= _IESO_ON
    cfg&= _FCMEN_ON
      __CONFIG cfg
    
    #ENDCONFIG
    DEFINE OSC 8 ; tells PBP we use a 8 MHZ clock 
    OSCCON = %01110000 
    
    ANSEL = 0  ;set all digital
    TRISA = %110100    ; Set RA5,RA4 and RA2 input, rest output
    TRISB = %0000     ; PORT B all output
    TRISC = %00000000  ; PORT C all output
    CM1CON0 = 0 ' Disable comparator 1
    CM2CON0 = 0 ' Disable comparator 2
    
    led1 var portc.4
    buton1 var porta.4
    led1flag var bit
    
    low led1
    let led1flag = 0
    
    init:
    read 10,led1flag
    pause 2
               
    main:
    if led1flag = 1 then
    high led1
    else 
    low led1
    endif
    if buton1 = 0 then  
    let led1flag = 1
    goto writetoeeprom
    endif
    goto main
    
    writetoeeprom:
    write 10, led1flag
    pause 2
    debounce:
    if buton1 = 0 then goto debounce
    goto init
    end
    Warning I'm not a teacher

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: 16F690 read/write

    Hello Richard,

    basically this is my code without changes, but after try It isn't work. Then I try to replace the chip (the previous is an brand new out of the box) to another brand new and ...
    ... man all works, the trevious chip was faulty, two days of labour and time wasting. Thank You for all support .

Similar Threads

  1. SD Card Write/Read
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th April 2014, 08:26
  2. PLEASE HELP...read write issues
    By nomad77 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th March 2011, 14:39
  3. Can't read an sms Using TC35i & 16F690
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 4th October 2009, 22:41
  4. I2C Read and Write
    By DerekMacom in forum mel PIC BASIC
    Replies: 14
    Last Post: - 21st April 2008, 15:44
  5. cannot read/write to 16F690 data memory after CPD_ON
    By awdsas in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd November 2006, 11:46

Members who have read this thread : 0

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