Generating sound with PIC

Home Forums MikroC Pro for PIC Tutorial Discussions Generating sound with PIC

Viewing 1 reply thread
  • Author
    Posts
    • #3919
      Avatarseverus snape
      Participant

      I wrote the code which is in the image below for pıc18f2220 and it says undeclared identifier ‘ANSELC’ in expression.Can you send the schematic proper for this code

      Attachments:
      You must be logged in to view attached files.
    • #3921
      Bitahwa BinduBitahwa Bindu
      Keymaster

      The PIC you used in mikroC project is PIC16F887, not PIC18F2220.

      You have a lot of mistakes in your project. It always good to try and understand the code instead of copy and paste.

      • First, you used PIC18F2220 in Proteus schematic but used PIC16F887 in mikroC.
      • In mikroC you selected to use an external oscillator (HS) but in Proteus there is no oscillator. It won’t work.
      • You enabled the MCLR pin in mikroC project, but unconnected in Proteus, the Project will keep on resetting.
      •  Why do you need ANSELC = 0;  on PORTC while you are connecting nothing to it? Did you read the comments?
      • Not all PIC have ANSEL register to disable analog functions on PIC. For this PIC, you can use ADCON1 register. See page 212 of PIC18F2220 datasheet.

       

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