16F913 setup


Closed Thread
Results 1 to 32 of 32

Thread: 16F913 setup

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    This is as far as i got, can somebody please help me with the errors mentioned below?

    DEFINE OSC 20 ' Define crystal as 20Mhz

    'This Part set PORTA 0-5 an analog inputs

    ADCON1 = %111 'FRC (clock derived from a dedicated internal oscillator = 500 kHz max)
    ANSEL = 0 'The ANSEL (91h) and CMCON0 (9Ch)registers must be initialized to configure an
    CMCON0= 0 'analog channel as a digital input. Pins configured as analog inputs will read ‘0’.
    TRISA = %00011111 'set PORTA 0-5 as inputs


    TRISC = %10001111 'Set PORTC for serial coms and pins 0 - 3 as inputs
    TRISB = %00000000 'Sert PORTb as outputs and for use with the ICD2


    ERROR Line 13: Syntax error.
    ERROR: RAM END must be defined.
    ERROR: RAM BANKS must be defined.
    ERROR: No LIBRARY statement or LIBRARY parameter.
    ERROR: No LIBRARY statement or MACRO parameter.
    ERROR: Unable to open file PBPMAC.INC

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    no such error here. Which version of PBP are you using?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    MPLAB 8 and PBP 2.46, i also do not get the error with microstudio

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, sounds like a corrupted file, did you tried to re-install PBP and it's patch for 2.46?
    http://www.melabs.com/support/patches.htm
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5


    Did you find this post helpful? Yes | No

    Smile

    thanks, i created a totaly new project and copied my code into it, it seems to have fixed the problem it compiles now without problems.
    is there any thing you think i left out to have the pic do what i setted out to do in my first post?

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Code:
    'This Part set PORTA 0-5 an analog inputs
    
    ADCON1 = %111 'FRC (clock derived from a dedicated internal oscillator = 500 kHz max)
    ANSEL = 0 'The ANSEL (91h) and CMCON0 (9Ch)registers must be initialized to configure an
    CMCON0= 0 'analog channel as a digital input. Pins configured as analog inputs will read ‘0’.
    TRISA = %00011111 'set PORTA 0-5 as inputs
    Nope, it disable all ADC channel <7:0>.
    http://ww1.microchip.com/downloads/e...Doc/41250F.pdf
    PDF page 45, Ansel Register.
    should be
    ANSEL = %00011111

    PDF page 183, ADCON1
    ADCON1 should be
    ADCON1=%01110000

    To disable comparators, cm<2:0> bits have to be = to 111

    so PDF page 118, CMCON0
    CMCON0=%00000111
    Last edited by mister_e; - 9th December 2007 at 20:00.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Acording to me this chould read the 0 - 5v signal on PORTA.0 and sends the digital value to hiperterminal, nothing seems to happen ,any help please
    Also i have just bought myself a ICD2 is there any special code i need to add to use the debug functions?

    DEFINE OSC 20 ' Define crystal as 20Mhz
    DEFINE HSER_BAUD 9600 ; 9600 Baud
    DEFINE HSER_CLROERR 1 ; Clear overflow automatically


    'This Part set PORTA 0-5 an analog inputs

    ADCON1 = %01110000 'FRC (clock derived from a dedicated internal oscillator = 500 kHz max)
    ANSEL = %00011111 'The ANSEL (91h) and CMCON0 (9Ch)registers must be initialized to configure an
    CMCON0 = %00000111 'analog channel as a digital input. Pins configured as analog inputs will read ‘0’.
    TRISA = %00011111 'set PORTA 0-5 as inputs

    TRISC = %10001111 'Set PORTC for serial coms and pins 0 - 3 as inputs
    TRISB = %00000000 'Sert PORTb as outputs and for use with the ICD2

    INTCON = 0 ;Disable interrupts

    V1 var byte

    loop:
    ADCIN PORTA.0,V1
    HSEROUT [DEC V1]
    PAUSE 500
    goto loop

  8. #8


    Did you find this post helpful? Yes | No

    Default Driving 2, 7-Segment LCD displays w/16F913

    Hi Mr. E and all others!

    I am new to the LCD "modules" in the 16F913 chip. I'm trying to get a basic breadboard going here using the minimum setup required to just send 2 digits to 2 displays. From there I can figure out everything else the chip needs to do. It's these damn module parameters that is screwing with my head. Specific pins to displays can be any arrangement for now.

    The App Note AN1070 and chip data leaves me confused when it comes to using PBP (v2.60) since data references are all in Assembler. Has anyone worked with this chip to arrive at a simple setup to map the pins, and how to setup the "mapping"? Do you need to create a lookup table to output the digits you want. The more I read the more I'm either missing the boat or reading too much into the minimums required to talk to the displays.

    Mega thanks, Frank

Similar Threads

  1. ADCIN - setup of ADCON2
    By Lowell314 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th December 2009, 18:41
  2. TMR1 external LP xtal setup check
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th October 2009, 18:11
  3. ADCIN setup for PIC16F688
    By PixController in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th February 2008, 18:38
  4. ADCIN setup help need
    By dangill in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th February 2008, 15:22
  5. Use Button For setup
    By tump in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 21st November 2007, 19:43

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