Log in

View Full Version : using all port pins


AMIRAM
21-01-2006, 12:54
Hi


can anyone tall me how can I export/inport data from all of port a pins

in the defult code the pins can be use only as bits


thanks

steven114
21-01-2006, 15:46
You may wish to restate your question, I'm having trouble understanding it. If you're trying to grab all of the data off of PORTA (the register in the microcontroller), then look at the header files (ifi_picdefs.h) and find an 8-bit variable with the name PORTA somewhere in it (don't remember exactly what it's called).

AMIRAM
22-01-2006, 01:58
In the FRC u have 18 digtal inputs/outputs that u can use i want to use 8 of them together to connect another microcontroller ...

can u understand now ?

steven114
22-01-2006, 14:37
You might be better off using the TTL serial port. If that's not an option, many PICs have a parallel port - I don't know if the pins that it uses are wired out to the front of the RC, but if they are you could use that to shift entire bytes in and out.

Failing that you can always just use the digital ins, shift and add. Something along the lines of IN_1 << 7 + IN_2 << 6 + IN_3 << 5 etc.

duane
23-01-2006, 00:52
In the FRC u have 18 digtal inputs/outputs that u can use i want to use 8 of them together to connect another microcontroller ...

can u understand now ?

You can look at the processor specific header file to figure out which port you want to use (I'm not sure which one it is this year). But here's an educated guess.

In ifi_aliases.h rc_dig_in01 is defined as:
#define rc_dig_in01 PORTBbits.RB2

The definition fo PORTBBits comes from the processor specific include file. There is also a corresponding definition for PORTB which is an unsigned char. (The linker must have a memory map that defines what addresses these ports are located.) That should provide you with an 8-bit wide read of all the lines.