![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
hi every one , i have problem with 16f877a microcontroller , the problem is how to deteminig the input and output ports
i need some helps please Last edited by MedoLee; 28th April 2008 at 11:11 AM. |
|
|
|
|
|
|
(permalink) |
|
Did you downloaded the data sheet?It has all the stuff regarding to that micro controller.
Last edited by Gayan Soyza; 28th April 2008 at 11:01 AM. |
|
|
|
|
|
|
(permalink) |
|
[quote=MedoLee]hi every one , i have problem with 16f877a microcontroller , the problem is how to deteminig the input and output ports
thak you very much Gayan Soyza but my problem is how can dieal with these input and out out ports MedoLee |
|
|
|
|
|
|
(permalink) |
|
Inputs and outputs port are those that begins with RA, RB, RC, RD and RE which is 33 pins all together.
You set the port input or output by setting the respective TRIS register, eg, TRISA, TRISB, TRISC, TRISD and TRISE. 1 for input and 0 for output.. Download the datasheet if u want to know more.. Last edited by MrNobody; 28th April 2008 at 11:13 AM. |
|
|
|
|
|
|
(permalink) |
|
thanx alot
MrNobody but my problem is : if you choose Port d as input in my programm is definded as (PORTD.??) dot what and thax alot again |
|
|
|
|
|
|
(permalink) | |
|
Quote:
If I understand you correctly, are you asking HOW to configure the PIC ports as either INPUTS or OUTPUTS, when writing the program.?
__________________
Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
||
|
|
|
|
|
(permalink) |
|
the problem is how can i dieal with this input port and assign the value of input port
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
Look at Nigels tutorials, they will explain. This link: http://www.winpicprog.co.uk/
__________________
Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
||
|
|
|
|
|
(permalink) |
|
Pulling my hair out in chunks!!
|
|
|
|
|
|
|
(permalink) |
|
Hey, why don't you tell us what you are trying to do..? I mean, what you are trying to achieve as in, the end result.. Are you trying to use a switch or something.. Tell us clearly and also include information like which pin you are using, and which pin is connected to what etc, coz we are struggling to understand what u mean..
|
|
|
|
|
|
|
(permalink) |
|
hi Mr N,
I think the problem is, that English is not his first language. It must be difficult asking technical questions in a 'foreign' language. Reading between the lines, I think he is asking how to configure the Port pins as I/O. Nigels tutorials give examples on how to do just that.
__________________
Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
|
|
|
|
|
|
(permalink) |
|
hi my friend my code is to recieve asignal from PORTD pin 1 (as input)and blinking a led in PORTB pin1 as output
for example void main() { PORTB=0; TRISB=0;//as output TRISD=1;//as input while(1) { if (PORTD.f1=1) PORTB.f7=1 ; else PORTB.f7=0; } } |
|
|
|
|
|
|
(permalink) |
|
MedoLee:
Refer here, I have already answered ur question there. Anyway, you wanted to use RD1 as input but you are setting RD0 as input instead. You wrote: TRISD = 1 --> TRISD = 0b00000001 --> Port D pin 0 as input but the rest as output Instead, you should use TRISD = 2 --> TRISD = 0b00000010 --> Port D pin 1 as input but the rest is output As what Eric has said, go to Nigel's Tutorials if you want to know more about it. |
|
|
|
|