Someone please help me out?


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2013
    Posts
    2

    Question Someone please help me out?

    First of all Hi, I'm new. Glad to meet you people.

    I am an extreme newbie here. I cannot for the life of me figure this out properly.

    I opened the example lcdx for PIC16F877A but I'm stupid, so I wanted to try to compile it for another PIC chip. PIC16F87 to be specific. I'm looking at the datasheet, and found ADCS1 in special register functions.

    So naturally, I thought it would just compile for it, but these lines stop the compilation.

    Code:
    ADCS1 = 7      ' Set PORTA and PORTE to digital
       Low PORTE.2
    It says:
    For ADCS1 = 7:
    Bad Expression
    For Low PORTE.2
    Syntax Error I think...
    Could someone explain to me how this works? I am so confused honestly.

    Could someone point me at an instruction set thinger for specific microcontrollers?

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Someone please help me out?

    Hello avanomi & welcome,
    ADCS1 is bit 7 of the ADCON0 register, you would " set " this bit as ADCON0.7 = 1 or ADCON0 = %10000000 Microchip Data sheet PP 129 .

    What it appears you are trying to do is to Disable the Synchronous Serial Port and use Port A as Digital I/O.
    Data sheet PP 83/84 SSPCON register bit 5 enables / disables SSP set it to zero and you are golden. Remember this chip has several
    Analog registers which have to be set to get digital I/O. ADCON0, ADCON1, ADRESH ADRESL . . . see page 43 for PortA registers, DO Use the index
    of the Data Sheet under registers.
    HTH
    EDIT:
    Page numbers could be off a bit due to Adobe reader showing different number from printed page, but close.
    EDIT EDIT: PortE ADCON1, TRISE 0:2 For port E, watch out for TRISE.4 if set will upset PortD's use as I/O. PP50:52
    Last edited by Archangel; - 19th July 2013 at 03:32.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jul 2013
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: Someone please help me out?

    Wow thanks, I feel like an idiot for 2 reasons, 1) Your explanation made sense. 2) Usually the new post is at the bottom, so I was reading my own post for a few minutes thinking you quoted it. lol

    Edit:
    I'm still a bit confused on the Low PORTE.2 part.

    Edit 2:
    Does ADCON stand for Analogue Digital Converter? (Wild Guess)
    Last edited by avanomi; - 19th July 2013 at 03:55.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Someone please help me out?

    First off . . . We've all been there, sometimes I spend a great deal of time there (feeling . . . )
    LOW command automatically sets the TRIS and Port registers for you, as far as I know it does not set the analog registers for you, I am not sure as I virtually never use it.
    ADCON is A/D Converter register, some chips do not use it as they have no A/D converters I E 16F628A has analog comparators but no ADCON.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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