View Full Version : HELP on reading the data sheet/weak pull-ups
sbobowski
- 7th September 2008, 16:39
ok i have the data sheet
http://ww1.microchip.com/downloads/en/DeviceDoc/40044F.pdf
Page 25, REGISTER 4-2: OPTION_REG – OPTION REGISTER (ADDRESS: 81h, 181h)
ok i understand that bit 7 needs to = 0 to turn these on.
I have read and read and read
would someone please teach me how to read this so i know what to type in PBP
alot of people say "TRISB = %00000000"
where do you get that out of the data sheet???
and if so how do you read it, whats with the %, seems to me I'm setting individual values with that line (which is fine by me the more i learn now the better)
I'm so confused
Thanks in advance
sbobowski
- 7th September 2008, 16:46
ok i found
OPTION_REG.7=0 ' Enable weak Pull-Ups
and micro code studio accepted that.
so why does option_reg not have a # behind them
and ADCON0 Does ???
Thanks again in advance
sorry if I'm a rock
rhino
- 7th September 2008, 18:11
ok i found
OPTION_REG.7=0 ' Enable weak Pull-Ups
and micro code studio accepted that.
so why does option_reg not have a # behind them
and ADCON0 Does ???
Thanks again in advance
sorry if I'm a rock
Not sure what you mean here..... the option register is 8 bits. With the statement OPTION_REG.7=0, bit 7 of the option register (bit 7 RBPU: PORTB Pull-up Enable bit
1 = PORTB pull-ups are disabled
0 = PORTB pull-ups are enabled by individual port latch values) enables weak pullups. Also from pg. 38 section 5.2
Each of the PORTB pins has a weak internal pull-up
(≈200 μA typical). A single control bit can turn on all the
pull-ups. This is done by clearing the RBPU
(OPTION<7>) bit. The weak pull-up is automatically
turned off when the port pin is configured as an output.
The pull-ups are disabled on Power-on Reset.. Not sure if I'm answering you question or not.
jderson
- 7th September 2008, 18:42
The data sheet in your post has no mention of ADCON0. Where did that come from?
Archangel
- 7th September 2008, 20:00
would someone please teach me how to read this so i know what to type in PBP
alot of people say "TRISB = %00000000"
TRIS = TRI STATE REGISTER so TrisA is tri state register of port A each port has 3 states,
input, output, unimplemented. Youset tris register by the bit so TrisA = %00000001 means bit zero is an input and the other 7 are outputs. You can address them individually just as easily like this TrisA.0 = 1 making PortA.0 an input. Port latches are done the same way,
example PortA = 0 all outputs low or PortA = %00000000 all portA outputs low, or PortA.1 = 1 ' portA 1 is high
and if so how do you read it, whats with the %, seems to me I'm setting individual values with that line (which is fine by me the more i learn now the better)
the % tells the compiler you are using binary. You could use decimal or hex just as well, I find binary easier because it gives a direct readout of the setting, ones are inputs zeros are outputs.
I'm so confused
Thanks in advance
Welcome to MY world, and the forum
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.