Microcontroller I/O configuration

inputmicrochipoutputpicport

I have been using PIC microcontrollers and have been using MikroC for the programming but I am little bit confused about the ports. On a PIC16F84A the port is defined in mikroC as TRISA = 0xFF, and a bit of the port can be accessed by PORTA.f0. But for other microcontrollers in the series a different code is used. For example, TRISIO = 0xFF.

Can you please explain to me how I can know the code for accessing the ports that applies for every microcontroller out there? Also the input for a PIC is 1 and output is 0, and for Atmel the input 0 and output 1 which I found confusing if someone can explain?

Best Answer

Try looking at the header files you're using, or like Scott Seidman mentioned the compiler datasheet

Microcontrollers datasheet aren't always going to have the exact variable names used in program (maybe in MPLAB) but most likely not in 3rd-party IDE like MikroC

MikroC Manual for PIC12, 16 and 18