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

Viewing 1 reply thread
  • Author
    Posts
    • #3040
      AvatarAM
      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>
       

       

    • #3044
      Bitahwa BinduBitahwa 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:

       

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Select your currency
ZARSouth African rand
EUR Euro