PIC16F1824, problem with oscillator and RA3,RA4,RA5


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Location
    Türkiye
    Posts
    103


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1824, problem with oscillator and RA3,RA4,RA5

    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* Author : BURAK GÜNAY *
    '* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 6.5.2014 *
    '* Version : 1.0 *
    '* Notes : 16F1824 RA<5:3> input mode *
    '* : *
    '************************************************* ***************

    #header
    errorlevel -303 ; suppress Program word too large
    #ENDHEADER

    #config
    __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
    __CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_19 & _LVP_OFF
    #ENDCONFIG
    '---------------------------------------------------------------------

    DEFINE OSC 4

    PORTA=%000000 : ANSELA=%00000 : TRISA=%111000
    PORTC=%00000000 : ANSELC=%0000000 : TRISC=%00000000

    START:

    IF PORTA.3=1 THEN
    GOTO LOOP1
    ELSE
    GOTO LOOP2
    ENDIF

    GOTO START


    LOOP1:

    IF PORTA.4=1 THEN
    PORTC.0=1
    ELSE
    PORTC.0=0
    pause 500
    PORTC.0= 1
    pause 500
    PORTC.0= 0
    ENDIF

    GOTO START


    LOOP2:

    IF PORTA.5 = 1 THEN
    PORTC.0 = 1
    ELSE
    PORTC.0 = 0
    ENDIF

    GOTO START







    This is the code you should be using ..

  2. #2
    Join Date
    Nov 2013
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1824, problem with oscillator and RA3,RA4,RA5

    When i compile it, it shows me syntax error in the lines from #header till #ENDCONFIG

  3. #3
    Join Date
    Nov 2013
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1824, problem with oscillator and RA3,RA4,RA5

    Ok. I compile it. According to http://melabs.com/support/config_defaults.htm i change the settings in PBP 16F1824.inc file and i add @ at the beggining of config.

    I will inform you for the results.
    Thank you!

Similar Threads

  1. Power up problem with PIC16F1824
    By nobner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th April 2013, 16:11
  2. PIC16F685 RA4/RA5 pins
    By Adrian in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 9th November 2008, 16:45
  3. PIC18F2320 RA4 output problem
    By Kristjan in forum General
    Replies: 2
    Last Post: - 31st May 2007, 00:56
  4. problem with output RA2 and RA3
    By savnik in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th December 2006, 14:49
  5. RA5/MCLR input in 16f88
    By kacho in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th April 2005, 18:21

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