PIC18F4620 Troubles


Closed Thread
Results 1 to 7 of 7

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    FYI, this DEFINE is the default one, if you don't write it yourself, PBP will do it for you in background.

    Let's see what happen in the .LST file, i compile those lines...
    Code:
    Define LCD_DREG PORTD ' Define LCD connections
    Define LCD_DBIT 4
    Define LCD_RSREG PORTE
    Define LCD_RSBIT 0
    Define LCD_EREG PORTE
    Define LCD_EBIT 1
    
    LCDOUT "Hello"
    Now, i open the .LST file, scroll to the end... and
    Code:
    LCD_BITS                          00000004
    LCD_COMMANDUS                     000007D0
    LCD_DATAUS                        00000032
    LCD_DBIT                          4
    LCD_DREG                          PORTD
    LCD_EBIT                          1
    LCD_EREG                          PORTE
    LCD_LINES                         00000002
    LCD_RSBIT                         0
    LCD_RSREG                         PORTE
    LCD_RWBIT                         00000000
    LCD_RWREG                         00000009
    everything is there. Now what happen, if i don't use any DEFINE
    Code:
    lcdout "Hello"
    .LST
    Code:
    LCD_BITS                          00000004
    LCD_COMMANDUS                     000007D0
    LCD_DATAUS                        00000032
    LCD_DBIT                          00000000
    LCD_DREG                          00000005 
    LCD_EBIT                          00000003
    LCD_EREG                          00000006
    LCD_LINES                         00000002
    LCD_RSBIT                         00000004
    LCD_RSREG                         00000005
    LCD_RWBIT                         00000004
    LCD_RWREG                         00000005
    Interesting eh! But i agree, it's always nice to have ALL DEFINE in your code, so if one day you decide to change them, it's just easy. PICMultiCalc also generate those.. kinda lazy stuff... and some day i am

    ---------------------------------------

    Finally: Please tell me why this should work. In trying to read all the fun stuff down in the chip technical papers I must be missing something and I definitely want to be more astute as to why as well as how.
    Well, why ADCON1 would have to work? Where did you get this value ?

    Let's see a datasheet snip...
    <IMG SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1634&stc=1&d=117924073 8">

    ADCON1=7 set PCFG3:PCFG0 to 0111.. right? If so, what happen to AN0,1,2,3,4,5,6,7 ?

    ADCON1=$0F set PCFG3:PCFG0 to 1111.. right? If so, what happen to AN0,1,2,3,4,5,6,7,8,9,10,11,12 ?

    I think it's the explanation :-)

    EDIT: Sorry PicUser.. we write at the same time !
    Attached Images Attached Images  
    Steve

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

  2. #2
    Join Date
    May 2007
    Location
    Harvest, Alabama
    Posts
    10


    Did you find this post helpful? Yes | No

    Smile Thanks

    You confirmed my research and it is always nice to have someone back up your thinking. It either means that the both of you are lost ... (not in this case) or that you actually understand what the other person is saying. (something nice)

    In any case thanks so much and I am sure I will be back and hopefully I will have nice helpful things for others as well.

    Paul

Similar Threads

  1. using ISD2560 on PIC18F4620
    By rookie in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 15th December 2008, 05:48
  2. PIC18F4620 Programming problem
    By JavPar in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 6th December 2008, 04:21
  3. ADCIN with PIC18F4620
    By Brian J Walsh in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th July 2008, 01:25
  4. PIC18F4620 Using the Internal Oscillator
    By kiwipiper in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd October 2007, 08:07
  5. PIC18F4620 not Target Device
    By kiwipiper in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th October 2007, 19:42

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