Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

is there any changes on the code if i change it to pic16f877a

Home Forums MikroC Pro for PIC Project Discussions is there any changes on the code if i change it to pic16f877a

This topic contains 1 reply, has 2 voices, and was last updated by  Bitahwa Bindu 8 months ago.

  • Author
    Posts
  • #3040

    AM
    Participant

    hi, by any chance is there any changes on the code if i change the pic18F26k20 to pic16f877a for the interfacing dc motor with PIC microcontroller?
    <div id=”crayon-5ad0306e52468831680601-36″ class=”crayon-line crayon-striped-line”></div>
     

     

    • This topic was modified 8 months ago by  AM.
    • This topic was modified 8 months ago by  AM.
  • #3044

    Bitahwa Bindu
    Keymaster

    We have commented out what should be changed in the code and replaced with correct code.

    Here is the summary:

    • Change LAT with PORT: Use PORT register to read and input or write an output when using the old models of PIC16F series, they don’t have the LAT register.
    • Delete these lines of codes:

    // ANSEL = 0; // Configure Analog pins as digital Input/Output pins
    // ANSELH = 0;
    //ADCON1
    // OSCCON = 0x66; // configure OSCCON to use 8MHz internal Oscillator

    • Because there is no need to disable the analog function as pins with analog features are on PORTA and PORTE, no analog pin on PORTB. If you want to disable analog features on PORTA/PORTE, use the ADCON1 register.
    • This PIC does not have internal oscillator, so remove OSCCON =0x66, you must use an external crystal connected to pins 13 and 14.

    Here is the complete code:

     

You must be logged in to reply to this topic.

Select your currency
EUR Euro
USD United States (US) dollar