[SOLVED !] 18F1320/16F877 help


Closed Thread
Results 1 to 5 of 5

Thread: 18F1320/16F877 help4217 days old

  1. #1
    KenGinn
    Guest KenGinn's Avatar

    0 Not allowed!

    Default 18F1320/16F877 help

    I have written a small application on the Proton dev board with a 16F877, part of which is shown below:

    Include "proton_g4.int" ' **** rem'd out for 1320
    'Device 18F1320 **** only used for 1320
    'Declare XTAL 4 **** only used for 1320
    Declare ADIN_RES 10 ' 10-bit result required
    Declare ADIN_TAD FRC ' RC OSC chosen
    Declare ADIN_STIME 100 ' Allow 100us sample time
    Dim VAR1 As Word
    TRISA = %00000001 ' Configure AN0 (PORTA.0) as an input
    ADCON1 = %10000000 ' Set analogue input on PORTA.0
    Dim b As Word
    Dim c As Word
    Dim rate As Word
    Input PORTB.5 ' rate select
    Output PORTB.7 ' pulse op
    Output PORTB.6 ' relay op

    rest of code not shown.....

    Noting the rem’d out lines for the Device and the XTAL, it works well on the prototype board. Transferring the code to a 1320 on the finished board, it just doesn't work. I am wondering if there is something I should have done to the 1320 code that need not be done to the 877.

    Basically I need to read the analogue voltage on port a.0 and control the operation of a relay and PWM a FET to drive a motor. I feel that the ADC isn't set correctly for the 1320, where as it works perfectly for the 877. Are there parameters that are just not needed to be set for the 877 on the development board that need to be set for the 1320? If so what?

    I don't want to use a 40 pin device on such a simple circuit, hence the use of a 1320.

    Any help any one?

    thanks

    Ken

  2. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Junior Member mjmccarron's Avatar
    Join Date
    Oct 2008
    Posts
    42
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    83.63 MB

    0 Not allowed!

    Default

    Hi,
    Look at section 17 of the 18f1320 datasheet. The ADCON registers are different for 18F parts. I ran into the same thing when I transitioned to 18F pics.
    Good Luck,
    --Mike
    Light travels faster than sound. That's why some people seem bright until you hear them speak.

  4. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster RGV250's Avatar
    Join Date
    Aug 2005
    Posts
    2,363
    Thumbs Up
    Received: 29
    Given: 7
    Total Downloaded
    1.16 GB

    0 Not allowed!

    Default

    Hi,
    Not sure but I think the 18 series are less tolerant with omissions in the config fuses, go through the datasheet and set all the config fuses to what you require.
    The new fuse configurator is the Biz but I think you need to be registered and have the beta version to use it.

    Regards,
    Bobby

  6. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    cgriffin
    Guest cgriffin's Avatar

    0 Not allowed!

    Default

    And the 16F877 is more tolerant to default register settings, too.

  8. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,989
    Thumbs Up
    Received: 31
    Given: 15
    Total Downloaded
    434.52 MB

    0 Not allowed!

    Default

    What everyone basically is saying is that pics are not just interchangeable. If the program runs on the 16F877 and you want to use the 18F1320 instead, then you have to compile it for the 18F1320.

    If the 18F1320's configuration settings are made correctly and the hardware use the same pin names there should be no problem.
    Fanie

  10. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Some help with a 18F1320
    By C_Moore in forum Proton Plus Compiler v3
    Replies: 8
    Last Post: 12th February 2009, 10:27
  2. [SOLVED !] Migrating from 16F88 to 18F1320
    By picyerknows in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 17th April 2008, 14:00
  3. [SOLVED !] Port A0 on 18F1320
    By MadAl in forum Proton Plus Compiler v3
    Replies: 14
    Last Post: 20th March 2008, 16:59
  4. Migrating to 18F1320 need help!
    By Shax in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 10th June 2007, 16:53
  5. 18F1320 bootloader
    By Trevor Wilson in forum Wish List / Product Feedback
    Replies: 0
    Last Post: 13th December 2003, 09:55

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts