Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   using all port pins (http://www.chiefdelphi.com/forums/showthread.php?t=42351)

AMIRAM 21-01-2006 12:54

using all port pins
 
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

Re: using all port pins
 
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

Re: using all port pins
 
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

Re: using all port pins
 
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

Re: using all port pins
 
Quote:

Originally Posted by AMIRAM
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.


All times are GMT -5. The time now is 17:30.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi