Continue to Site

# 8 Pin Pic problem Help appreciated :)

Status
Not open for further replies.

#### bigal_scorpio

##### Active Member
Hi to all,

I am baffled by the syntax for IO on the 12 series Pics!

I am using and trying to learn MikroBasic from MikroElektronika and all the info and examples I can find in the manual or CD do not cover the use of IO on the 12 series.

Whereas the 16 series and up have port and pin commands, these don't work on the single ported 12s.

Can anyone explain simply what the syntax is for the IO on the 12 or 10 series Pics? Examples would be the best way as I am at what my wife calls a stupid age! hehe

The manual and CD with ME basic does not have any examples of changing and using certain pins on anything other than 16 series or above so I am quite stuck at the moment.

What I am aiming at is to use 2 pins of a 12F629 for input and the other 4 for output to drive a stepper motor, can anyone help?

Thanks for reading my drivel and I hope someone will help me......Al

#### Diver300

##### Well-Known Member
TRISIO is register 0x85, and GPIO is register 0x05.

In assembly language, the only complication is bank switching. I guess that is taken care of in Basic, so you should be able to write directly to the TRISIO and the GPIO registers.

#### Nigel Goodwin

##### Super Moderator
TRISIO is register 0x85, and GPIO is register 0x05.

That's the numerical value in the Include files, in actual fact both are at physical address 0x05 but in different banks.

#### AllVol

##### New Member
Hi to all,

I am baffled by the syntax for IO on the 12 series Pics!

In case you haven't seen this, check out the attachment.

#### Attachments

• GPIO_howto.GIF
34.1 KB · Views: 125

#### bigal_scorpio

##### Active Member
Hi guys,

Hows it going Nigel?

I think you both missed my point. remember I am Pic Thick! hehe

All I need is how to phrase the commands for the 12series Pics in basic, I mean usually the manual and examples "TRISIO B,3" but when port B does not exist what do I put? Puzzled. The manual assumes that I know something that I obviously don't. Doh!

Regards.........Al

#### birdman0_o

##### Active Member
It becomes GPIO for pic12f doesn't it?

Eg. GPIO = b'00001111'
or TRISIO = b'00000111'

#### be80be

##### Well-Known Member
Microbasic works just like the microC it uses
Code:
GPIO.B1 =1
AND
TRISIO.B1 =1
to set just a pin or like bird said to set a port

Last edited:
Status
Not open for further replies.

Replies
0
Views
120
Replies
10
Views
1K
Replies
4
Views
2K
Replies
4
Views
964
Replies
41
Views
3K