Maker Pro
Maker Pro

pic12c508a - TRIS Reg

C

ChronoFish

Jan 1, 1970
0
It's been a while since I've done any PIC programming, and even then it was just a single project. So please excuse my ignorance
here...

In the 16c84 there you configure an I/O "mask" by setting the TRIS register for it's associated port.

In the 12c508a there is only one port - the gpio. The datasheet indicates that you give the gpio an I/O "mask" with the TRIS
register, but it doesn't tell you where the TRIS register is located. Actually it specifies it as "N/A".

I'm trying to program this little PIC with C2C (sorry guys - I'm a software guy - not a hardware guy and I'm very uncomfortable with
assembly - even if it only has 35 instructions) - but it doesn't define a TRIS register for the 12c5XX series.

Any insight would be greatly appreciated.

Thanks!
CF
 
B

Ben Jackson

Jan 1, 1970
0
In the 12c508a there is only one port - the gpio. The datasheet
indicates that you give the gpio an I/O "mask" with the TRIS
register, but it doesn't tell you where the TRIS register is located.

I think on those old parts you are supposed to use the TRIS instruction,
not a register. Then in later chips the TRIS instruction is deprecated
and you're supposed to use the register(s).

Do yourself a favor and get a 12F657 or 12F629 instead...
 
S

Spehro Pefhany

Jan 1, 1970
0
I think on those old parts you are supposed to use the TRIS instruction,
not a register. Then in later chips the TRIS instruction is deprecated
and you're supposed to use the register(s).

Yup. Look in the datasheet, it's something like movlw xxx tris 6. I
have no idea if "C2C" includes some special instruction to do this,
but I should think you could use inline assembly in any case.
Do yourself a favor and get a 12F657 or 12F629 instead...

Agree with this. If you don't know, the above-mentioned parts have
14-bit cores rather than 12-bit, despite the numbering scheme.

Best regards,
Spehro Pefhany
 
B

Ben Jackson

Jan 1, 1970
0
I just realized while reading Spehro's quote of my post that I made a
typo there -- I meant 12F675.
 
Top