Stupid question about ports

6 views
Skip to first unread message

klaine8

unread,
Nov 21, 2009, 4:52:17 AM11/21/09
to PIC32-Basic, kla...@gmail.com
Hi All,

I am learning this BV513 and I don't know whether I am thick or
something...

Anyway BV513 Socket layout gives me problems. How I relate port name
used in BV-Basic to physical pin on the BV513. And then the biggest
snag. In the document there are several definition for example to PORT
D. Let's take few examples

PORT G
RG9 ** JP3-8 **-#SS2 ** PMA2 ** CN11

PORT D
RD10 ** JP4-6 ** PMCS2 ** PMA15 ** IC3 ** INT3

PORT B
RB0 ** JP3-16 ** CN2 ** AN0 ** PMA6 ** PGD1 ** EMUD

So each pin of the PIC can have multiple functions. I have not figured
out how to select them. Or how to read the ports document. Have I
understood right that BV513 uses some PIC pins for example to I2C and
those pins cannot be used if I2C functionality is used? Is it so that
if I2C is not used those pins can be used to general purpose IO?

I would be very thankful if someone could please explain this to me.

Best Regards
Kari Laine

peter247

unread,
Nov 21, 2009, 3:33:04 PM11/21/09
to PIC32-Basic
You have it just about right there.

Most pin has multi-function, so you have to know the limit placed on
some of the pin.

Eg the pin with analogue to digital function are not 5 volt tolerant,
Which pin have built in pull up resistor etc

Yes , if you don`t use the i2c then it`s pin are free to be used .

I use ports D and E

Read http://www.pic32.byvac.com/pic32_ports.php

Kari Laine

unread,
Nov 22, 2009, 1:24:19 AM11/22/09
to pic32...@googlegroups.com
Hi Peter,

>
> I use ports D and E
Could you please give a code example how to select ports D and E?

>
> Read  http://www.pic32.byvac.com/pic32_ports.php
I have read it severall times...

Best Regards
Kari

peter247

unread,
Nov 22, 2009, 3:52:42 AM11/22/09
to PIC32-Basic
function check_buttons
dim pd
portb "ei" pd
if and(pd,31) <> 0 then
button = and(pd,31)
endif
endf

The above code reads from my switches .

portb "E < portE i < input pd < save result to pd
and out the first 5 bits and save to button

Kari Laine

unread,
Nov 22, 2009, 5:21:32 AM11/22/09
to pic32...@googlegroups.com
THANKS!

Now I GOT it - hip hei.

Best Regards
Kari
Reply all
Reply to author
Forward
0 new messages