Products > Programming

PIC ports and C

(1/4) > >>

PerranOak:
Using a 16F1827 I get that to address a port is, say:

PORTBbits.RB5=1

But, when I want to do the same for a 12F683 (which has no PORTA or PORTB) how do I know how to address it?

I've looked in the 12F683 datasheet (all assembly examples) and the compiler user guide to no avail.

Cheers.

[using MPLAB X IDE v5.25 and XC8 v2.10]

StillTrying:
GPIO = 0b111111;
or
GPIO0 = 1;
to
GPIO5 = 1;
...probably.

SiliconWizard:
Why not look at the header file corresponding to your PIC model in the compiler's distribution?
You'll see all definitions you need in there.

PerranOak:
Cheers both.

"Compiler's distribution" - what's that?

StillTrying:
Start a new blank 12F683 project, and look in the source and include files MPLAB adds to it?
The single port ICs are always GPIO AFAIK.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod