Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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
 
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.
 

Attachments

  • GPIO_howto.GIF
    GPIO_howto.GIF
    34.1 KB · Views: 158
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
 
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top