15 Threads found on edaboard.com: Porta Digital Input
0. Make sure your port is working fine...!!! (very common mistake). Put some leds on your port and turn them on and off. In PIC16f877a whole porta is an analog input and NOT digital I/O
1. Turn Off all the unused peripherals of microcontroller which are not in use...LIKE ADC, Timer...etc (Some are ON by default in PIC micr
Microcontrollers :: 03-16-2013 17:44 :: nikhilsigma :: Replies: 4 :: Views: 1400
I have an IR sensor..
I want it to be an input to my microcontroller..
How would I write the codes if my sensor is in porta and my output is in PortC?
Microcontrollers :: 03-11-2013 15:14 :: UyAb :: Replies: 7 :: Views: 666
porta is bidirectional port, can be digital or analog,
Data direction register is TRISA, if you set "1" in TRISA reg the pin will be input, if you set "0" pin will be output (Hemnath explaine this in previous post)
ADCON1 register configures the function of pins on porta, to be digital or analog,
Microcontrollers :: 02-26-2013 20:00 :: pasicr :: Replies: 26 :: Views: 4176
These two settings are wrong
ADCON1= 0b00000000; //set porta as analog input
ADCON0= 0b01000011; //configure AN0 and AN1 as analog channel
You are using switches on RA0 and RA1. They have to be digital inputs.
Change the code like this and try.
Microcontrollers :: 11-06-2012 04:56 :: internetuser2k12 :: Replies: 6 :: Views: 2370
My Question is how to use porta, PORTC and PORTE same as I use PORTB and PORTD as digital input/Output?
Thanks in advance.
Setting the corresponding TRIS bits to 1 will configure the pins as input and setting them to 0 will configure the pins as output.
You must disable the ADC and comparator if you
Microcontrollers :: 07-29-2012 19:37 :: Tahmid :: Replies: 4 :: Views: 29291
porta normally can function as analog input. So, you need set address (ADCON0) to set as digital I/O.
Microcontrollers :: 02-20-2012 03:20 :: engshahrul :: Replies: 5 :: Views: 1729
for setting port A and E as digital and disable PSP, is the below code enough, or we need any further declaration ?
ADCON1 = 0x07 ; //Disable all analogs
CMCON = 7; //Disable all comparators
TRISE.f4 = 0; //PSP off
trisa=0xff; // porta as input
trise=0xff; // porte as (...)
Microcontrollers :: 01-28-2012 11:46 :: varunme :: Replies: 0 :: Views: 1241
Also, remember that porta pins may have alternate analogue functions (depending on your microcontroller). So, you need to set the PORT to digital. You may need to disable ADC and comparator. Check the respective datasheet for details.
Hope this helps.
Microcontrollers :: 02-04-2011 18:46 :: Tahmid :: Replies: 4 :: Views: 2183
The port of ATMEGA is pin addressable. The way each pin is addressed depends on your compiler. eg:
In mikroC, I can do
.1 = 1;or
RA1_bit = 1;In AVR Studio GCC (WinAVR), I can do
|= (1<porta,1You should know that each pin has additional functions, e
Microcontrollers :: 12-23-2010 13:24 :: Tahmid :: Replies: 3 :: Views: 2044
you are taking input on porta and by default porta is assigned to ADC you need to first configure porta as a digital port in ADCON1 register then proceed forward.
it will work
Microcontrollers :: 03-17-2010 06:33 :: saeed_pk :: Replies: 4 :: Views: 939
Try this instead:
dim temp_res as word
ANSEL = 0x04 ' Configure AN2 pin as analog
ANSELH = 0 ' Configure other AN pins as digital I/O
C1ON_bit = 0 ' Disable comparators
C2ON_bit = 0
TRISA = 0xFF ' porta is input
TRISC = 0 ' PORTC is output
TRISD = 0 ' P
Microcontrollers :: 02-09-2010 14:20 :: Tahmid :: Replies: 8 :: Views: 5809
Just tell us what output you are getting exactly. If you are trying to output some value on porta, then you need to configure it as digital I/O since it is initialised as analog input pin for ADC after reset. Put ADCON1=6 at the beginning. Also refer to the ADC section in the datasheet.
Microcontrollers :: 01-27-2010 13:31 :: matbob :: Replies: 7 :: Views: 1404
I need a program code which will take analog input voltage from channel 0 of porta, convert it to 10 bit digital binary number, store the number in EEPROM data memory. Take another input from same channel after 15 minutes and again save it to EEPROM data memory. When I press a switch connected with RC0, the LCD connected with POR
Microcontrollers :: 09-03-2009 22:05 :: shimanto :: Replies: 3 :: Views: 2766
I am new to the micro-controller arena. I am using the PIC16F676 flash starter kit by microchip. I have written a small program to toggle certain LEDs on the demo board on the switch being closed(SW1). As I understand the pin 'RA3' can only be used as an input to the pic, so I don't have to configure it separately rite? also is this RA3 p
Microcontrollers :: 05-24-2009 01:13 :: dhruv101 :: Replies: 3 :: Views: 2143
On the 16F877 porta is switched to analog input on reset.
If you want to use it as digital I/O you must put this into your init routine:
Check the datasheet ...
hope this helps and best regards
Microcontrollers :: 12-18-2005 08:58 :: C-Man :: Replies: 14 :: Views: 30909