PIC24F16KM204

General discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
JimKueneman
Posts: 417
Joined: 10 Jan 2009 22:03

PIC24F16KM204

#1 Post by JimKueneman » 10 Nov 2017 06:27

Does anyone have a simple example of this family of parts that they know runs. Especially the configuration bits. I am programing this:

Code: Select all

program Sparky;

{ Declarations section }

begin
  { Main program }
  TRISB := 0;  // Outputs
  PORTB := 0;
  while true do
  begin
    LATB := not PortB;
    Delay_ms(100);
  end;
end.
Just to try to toggle pins and it pulls almost no current and the pins don't flash. Feels like the clock is not setup right.

I am using MPLab to program the part through a PICkit3 which is programming and verifying just fine.

I am sure there is one little thing I don't have setup correctly.......

Thanks,
Jim

User avatar
dusan.poluga
mikroElektronika team
Posts: 780
Joined: 02 Feb 2017 14:21

Re: PIC24F16KM204

#2 Post by dusan.poluga » 10 Nov 2017 10:51

Hi,

ANSELB needs to be set to configure the pins as digital.
Write this line at the beginning of your code to set the pins to be digital.

Code: Select all

ANSELB := 0;
Best Regards,
Dusan Poluga.

JimKueneman
Posts: 417
Joined: 10 Jan 2009 22:03

Re: PIC24F16KM204

#3 Post by JimKueneman » 10 Nov 2017 11:46

Arrggggg.......

Thanks,
Jim

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 General”