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 13:44 :: nikhilsigma :: Replies: 4 :: Views: 1162
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 11:14 :: UyAb :: Replies: 7 :: Views: 617
i tried this my friend...but it is not working..e.g.when i connect switch to any pin of port A, then according to the program the o/p LED should turn on when the switch is closed..this is not happening when i m using port A....but same function works when i use port B as an input port...i need more port pins, that's why i m looking for porta otherw
Microcontrollers :: 02-26-2013 14:09 :: samz kazi :: Replies: 26 :: Views: 3672
I'm making a solar tracking system for my project with using PIC16F877 and ULN2803 for the solar tracking system's motor drive circuit and the crystal oscilator that i use is 20MHz.
I not really sure is it my coding problem or circuit problem but I suspect is my coding problem cause the motor cannot be operate.
What I wana do is,
when my port
Microcontrollers :: 11-05-2012 11:48 :: kerkenglow :: Replies: 6 :: Views: 2138
I have problems in configuring my MCU as input and also Output in my simple project. My goal on my program is like example, when RA0 of porta is toggled, all PORTB will blink ON-OFF, if I toggle RB0 of PORTB, all PORTC will blink ON-OFF, and if I toggle RC0, all PORTD will blink ON-OFF, etc....
I have a little background of programmi
Microcontrollers :: 07-29-2012 11:34 :: nooobboy4321 :: Replies: 4 :: Views: 24097
What model of the PIC18F family are you using in your design?
There are often several peripheral modules which share various PORTs, especially porta, you may need to disable these peripheral modules before you can use porta as digital I/O.
A few more issues:
I would strong recommend you disable the Watchdog Timer in the (...)
Microcontrollers :: 02-19-2012 18:25 :: bigdogguru :: Replies: 5 :: Views: 1577
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 06:46 :: varunme :: Replies: 0 :: Views: 1100
i need a help for how to implement the logic of geting input from dip switch to PORTB and output them to the porta that will be connected to the leds..i want a c Progamm that clearifies my logic of how to read input from dip switch..m using Mikro c Pro there any built in function in the library of mikro c Pro ?
Microcontrollers :: 01-28-2011 12:06 :: chaudhryali55 :: Replies: 4 :: Views: 1983
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 08:24 :: Tahmid :: Replies: 3 :: Views: 1871
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 02:33 :: saeed_pk :: Replies: 4 :: Views: 894
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 09:20 :: Tahmid :: Replies: 8 :: Views: 5580
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 08:31 :: matbob :: Replies: 7 :: Views: 1333
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 18:05 :: shimanto :: Replies: 3 :: Views: 2676
porta,3 is also the Mclr pin of the chip.
You will note that your config line states Mclr=ON which tell the chip to act on the input state of the pin RA3 to Reset or Run - so that confilcts with you trying to use it as digital input.
Don't have the circuit diagram, but assume the 'switch ' you are talking about is a (...)
Microcontrollers :: 05-24-2009 04:50 :: wp100 :: Replies: 3 :: Views: 2017
I'm using Hi-tech PicC-lite compiler,it comes with some sample C codes.The routines in LCD.c work quite fine for 16F84 but when I change to 16F877 with the same pin connections nothing promts on LCD. The code is below....
Thanx in advance...
* LCD i
Microcontrollers :: 12-17-2005 13:52 :: bjerkely :: Replies: 14 :: Views: 30553