开发者

read port RB7 or other port from PICF184550 in program language C

I'm using the picdem F184550, I want to read the value of the led, I'm using the mplab ide v8.63 with a C compiler. but I don't have a idea how to interface with the port RB7 where my led with a resis开发者_如何学Pythontor is connected to. The question is, how can I read the port RB7 where my led is connected to in the program language C. thanks! (see picture

read port RB7 or other port from PICF184550 in program language C


This depends on the compiling suite you are using.

Those provided by Microchip (C18 for 18F MCUs) usually define all available ports & registers in a header file specific to your device (something like p18F4550.h in your case).

In this header, you will have a structure definition corresponding to your specific port register. You can access to your specific RB7 I/O,within the following field : PORTBbits.RB7

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜