Searching \ for '(Fwd) Re: [PIC] Why me ?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: '(Fwd) Re: [PIC] Why me ?'.

Truncated match.
PICList Thread
'(Fwd) Re: [PIC] Why me ?'
2011\10\25@170850 by Brent Brown

picon face
part 1 5575 bytes content-type:text/plain; charset="us-ascii" (decoded quoted-printable)

On 25 Oct 2011 at 22:45, Yigit Turgut wrote:

{Quote hidden}

A few things to ponder:

- RB4 is also an analog input on your PIC, you probably need to disbale the analog function to use it as a digital input.

- You set RB4 as an input (TRISB=00010000), then write 1 to RB4 output (PORTB = 00010000). Shouldn't affect anything input but it doesn't make any sense.

- What compiler are you using and what units does it default to, eg. dec/hex/bin? This would make it more definitive:
TRISB = 0b00010000;
PORTB = 0b00010000;

- In the code snippet above it looks like you have forgotten MOTR = 0 in the else section. Motor will go one way then stop. Based on your previous emails that have said motor is connected directly between the two pins.

{Quote hidden}

No comments on your second code example. I will only add that instead of with a motor you might like to try it with back to back LEDs (and a resistor). This would rule out any potential issues with driving the motor as previously discussed.
> Either I am doing something fundamentally wrong and I can't spot it or
> this is a bug or something;
> > What can I possibly be doing wrong ? It's a simple I/O operation and
> is driving me crazy. I have been trying to get over this for more than
> 40 hours and couldn't succeed. Seeking for serious guidance here, I am
> sure most of you implemented much more complex stuff thousands of
> times.

It's not uncommon to get stuck on something seemingly trivial. Hang in there, be methodical, keep your assumptions in check, break it down piece by piece... then put it all back together!
> Thank you and sorry for the long post.

-- Brent Brown, Electronic Design Solutions
16 English Street, St Andrews,
Hamilton 3200, New Zealand
Ph: +64 7 849 0069
Fax: +64 7 849 0071
Cell: +64 27 433 4069
eMail:  spam_OUTbrent.brownTakeThisOuTspamclear.net.nz




part 2 5378 bytes content-type:application/octet-stream; name="WPM$0L7A.PM$" (decode)

part 3 181 bytes content-type:text/plain; name="ATT00001.txt"
(decoded base64)

--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist

More... (looser matching)
- Last day of these posts
- In 2011 , 2012 only
- Today
- New search...