Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F877 and Resolution

Status
Not open for further replies.

TeslaUnit

Newbie level 3
Joined
Jul 17, 2008
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,312
Hello!

I have a current problem with my 16F877 that I really need help solving. What I am doing is going through the ADC process but I am not recieving the resolution (hope im refering to this properly) that I desire. My +Vref is +5V, and the current result i am recieving is not at the sensetive as I want.

To better explain myself is my current results based on the input (V) and the output after the ADC.

1V - 0000 0000bits
2V - 0000 0001bits
3.3V - 0000 0010bits
5V - 0000 0011bits

Therefore I want it to use the whole span of the register (all 8 bits) and to adjust the digital output after, for instance, a change in ever 100mV.

Thanks!
 

I just double checked my registers and that doesn't seem to be the problem.

My ADCON1 is set to right justified as follows:

movlw 80h
movwf ADCON1

Therefore ADRESL would hold 8bits and ADRESH would hold 2bits. Though to double check I had ADRESL going strait to the LCD, and ADRESH going to an LED board.

Now on the LCD as I adjusted my input amplitude (at the ADC), the LCD displayed 4 different characters only (its going from RESL to temporary storage, strait to LCD port). As well, the characters are sometimes different between power ups (the ones that show up on LCD) - making me wonder if its working properly at all, since they should be the same ever time. (since its the same bit values)

And at the LED board, I experianced the same thing, where I only got 4 bits to change. (00 - 01 - 10 - 11)

It apppears both are storing the same amount of bits.!!

Added after 57 minutes:

Success! I managed to get it working properly. For some reason its was a simple solution - I just changed the justification from right to left..and it just took off. Anyways thanks for the help.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top