GPPIO use

General discussion on mikroC PRO for 8051.
Post Reply
Author
Message
edutronic
Posts: 1
Joined: 20 Aug 2018 13:13

GPPIO use

#1 Post by edutronic » 20 Aug 2018 13:23

Hello,

How do I configure a gpio pin as input? How do I check the logical level of this pin?

Thank you very much

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: GPPIO use

#2 Post by filip.grujcic » 22 Aug 2018 13:30

Hi,

I'm not sure if it is the same for every 8051 MCU, so I would advise you to refer to the datasheet.
The screenshot below is from AT89S8253 datasheet.
As you can see, to make a pin an input pin, you write all 1s to it. Like:
P0 = 255;

Kind regards,
Attachments
Screenshot_1.jpg
Screenshot_1.jpg (58.21 KiB) Viewed 2938 times
Filip Grujcic

Post Reply

Return to “mikroC PRO for 8051 General”