Searching \ for ' PIC hangs on I/O operation' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=i%2Fo
Search entire site for: 'PIC hangs on I/O operation'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] PIC hangs on I/O operation'
2000\07\17@083707 by Johan Fredriksson

picon face
I've tried this on 12C509A and 16F877 with the same result. I'm just looping
forever reading two pins and sending a text on RS-232. I'm using CCS
compiler for coding.

  while (-1){
     if (INPUT(PIN_B3)){
        printf("B3 High\n\r");
     } else {
        printf("B3 Low\n\r");}
     delay_ms(250);

     if (INPUT(PIN_B4)){
        printf("B4 High\n\r");
     } else {
        printf("B4 Low\n\r");}
     delay_ms(250);
  }

Pin B3 gets a logic 1 (4.95V) or 0 (0.01V) and pin B4 is always high. The
input to B3 comes from a Hall-effect switch. When it detects a magnet it
gows low and when magnet is removed it goes, of course, high again (pull-up
to +5V and the Hall acts like a transistor driving to ground). The logic
output is OK all the time.

When removing the magnet so it goes high again the PIC is dead. But not
compleatly dead! If I add the magnet again so it goes low the PIC continues
from where it was again.

Anyone having some hints or ideas? I'm very confused now :-)

/Johan

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\17@085157 by Michael Rigby-Jones

flavicon
face
Not familliar with the CCS compiler, but just as a thought, its serial comms
library dosen't use pin B4 for flow control does it?

Cheers

Mike

> {Original Message removed}

2000\07\17@093322 by Johan Fredriksson

picon face
Nop...the same effect without the ser library loaded. To be on the secure
side I removed it anyway and inserted two LED's to indicate high/low.

I tested to put both B3/B4 to +5V and it shows high then I put B4 to ground
and it show that it gows low. Now...if I put B4 back to +5V the PIC hangs
again! Putting B4 back to ground it starts running.

I can't think of a simpler I/O routinethan this and it still doesn't work!

Regards
/Johan

-----Ursprungligt meddelande-----
Från: pic microcontroller discussion list
[spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU]För Michael Rigby-Jones
Skickat: den 17 juli 2000 14:50
Till: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
Ämne: Re: PIC hangs on I/O operation


Not familliar with the CCS compiler, but just as a thought, its serial comms
library dosen't use pin B4 for flow control does it?

Cheers

Mike

> {Original Message removed}

2000\07\17@094632 by Michael Rigby-Jones

flavicon
face
Hmm..tricky one!  Check that you don't have the PortB interrupt on change
enabled by mistake.  Also check that you have a good +5 and 0v on the supply
pins.  If on rail is not connected, the PIC can be powered through the port
pins, resulting in some very odd behaviour.

Mike
> {Original Message removed}

2000\07\17@100239 by hkte

picon face
Chek if you had disbled the Low Voltage Programming in then Config !

Got the same Problem in Asembler Projekt just a few days ago.

Regards
Heiner

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\17@101814 by Phillip Vogel

flavicon
face
Make sure you've disable low votage programming (#FUSES NOLVP)
p.
--
Phillip M. Vogel, President   | "It's not what you've been taught,
Bartal Design Group, Inc.     |  it's what you've learned." (me)
318 Marlboro Road             | +1-201-567-1343 FAX:+1-201-568-2891
Englewood, NJ 07631  USA      | phillipspamKILLspambartal.com

Johan Fredriksson wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\17@110629 by Michael Rigby-Jones

flavicon
face
The 12C509 dosen't have LVP does it?

Mike

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\17@124907 by Dale Botkin

flavicon
face
Johan,

You may want to try writing your own 250ms delay routine (probably as a
chunk of #asm code) and get rid of the delay_ms() calls.  I had NO END of
problems trying to get anything working on a system I'm working on now
until I did that.  It seems delay_ms and delay_us screw with a lot of
things (or at least I think so), but I can't find documented anywhere how
they work exactly.  I have not gone looking for the source code for those
functions yet.  Anyway, this may not fix your problem, but it's a thought.

Dale

On Mon, 17 Jul 2000, Johan Fredriksson wrote:

{Quote hidden}

---
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
               -- Isaac Asimov

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\17@220701 by James Cameron

flavicon
face
Last time I had this happen was when I failed to pull up MCLR.  ;-)
It was quite neat, waving my hand over the board to make it work.

--
James Cameron    @spam@quozlKILLspamspamus.netrek.org     http://quozl.netrek.org/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\18@085007 by Ries van Twisk

flavicon
face
Tip:

What I alway's do when i encounter such problems is to take a look at what the compiler generated. Just maby it made a compile error.
I always write my code in C or C++, no exeption but when I encounter problems i always dive into the deep sea of machine code. Maby it's the RS232 routines (printf) that stop's responding in some way.

Ries

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\07\20@024906 by Dr. Imre Bartfai

flavicon
face
Hi,
could you send the whole source code? The pragmas, initial settings, etc.
may be also of interest. At the moment, I do not see any suspicious part
in the said code fragment. But it does not mean anything...

Regards,
Imre


On Mon, 17 Jul 2000, Johan Fredriksson wrote:

{Quote hidden}

> > {Original Message removed}

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