PIC12F683 AN3 not going low

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

PIC12F683 AN3 not going low

Post by Ondra »

Good day all. I think I found a bug while using the PIC12F683. I have no problem setting Pin 2 Port A3 high(1), but for some reason It will not go low(0). When I tried to send a low(0), what happened is that the pin disconnects, no output at all. Could someone have a look into this. Thanks in advance.

Ondra

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Benj »

Hello Ondra

Pin 2 on the 12F683 is I/O pin GP5. Did you mean GP5 (pin 2) or GP3 (pin 4)?
12F683.JPG
12F683.JPG (52.12 KiB) Viewed 7927 times

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Ondra »

Yes, GP5, Pin 2.

Ondra

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Benj »

Hello Ondra

Ok thats a strange one then. Are you definatley using the internal oscillator with no clock out setting in the chip configuration options. When you set the pin to logic 0 does it go into high impedance mode or does the pin simly stay at 5V? Do you have another 12F683 that you can test to see if it exhibits the same behaviour? The pin also function as as an input for the timer1 clock, I dont think this will be a problem but just out of interest are you using timer1 in your program?

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Ondra »

Are you definitely using the internal oscillator with no clock out setting in the chip configuration options.
Yes.
When you set the pin to logic 0 does it go into high impedance mode or does the pin simly stay at 5V?
High impedance.
Do you have another 12F683 that you can test to see if it exhibits the same behaviour?
Yes, and I did and yes it did.
The pin also function as as an input for the timer1 clock, I dont think this will be a problem but just out of interest are you using timer1 in your program?
No, I'm not using timer 1.

Just for the record, I did set other pins on the port to 0 and they worked fine. I made a simple program just switching 3 pins to 0 and they all worked except GP5, Pin 2.

Ondra

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Ondra »

Hi Benj, any Ideas on this issue?

Ondra

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Benj »

Hello Ondra

Im running out of ideas for this.

One idea is related to the power up time configuration setting. If this is enabled then maybe try disabling it just incase it is linked to the timer1 peripheral and the I/O pin.

The only other idea I have left is that the pin for some reason cannot sink current, I see no real mention of this in the datasheet but it might be worth a go. If you add say a 4.7K - 10K resistor between the I/O pin and ground then hopefully the pin should start behaiving as normal.

Let me know how you get on.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PIC12F683 AN3 not going low

Post by medelec35 »

What are your configuration settings (hex value) ?
Are you programming configuration settings via ppp and programmer or are you using Flowcode to set configuration settings via Chip configure e.g 0x2007,0xf98

If you could upload your Flowcode, I’m sure someone can solve the mystery.
Martin

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Ondra »

Ok here is something else. When I output a 1. Using my multimeter I get a value of 2.11volts when I should be getting a value of 4.67volts. This value 4.67 is being output by the other pins.
Are you programming configuration settings via ppp and programmer or are you using Flowcode to set configuration settings via Chip configure e.g 0x2007,0xf98

Configuration settings via ppp and programmer

Here is a copy of the file. Thank for your help.


Ondra
Attachments
test.fcf
(7 KiB) Downloaded 245 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PIC12F683 AN3 not going low

Post by medelec35 »

If you are getting a lower than expected voltage, then either there is a extra load connected to pin dragging voltage down, or what is more likely, pin is not in a steady state, i.e it is oscillating and your meter is measuring the average D.C Voltage. that would suggest configuration requires a closer look. When you use ppp to program chip, what is the displayed config value?
Not had a chance to look at your program yet. Have you tried with a flowcode program with just 1 function and that is to put GP5 high, no timers running etc.
Martin

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Ondra »

There is no load connected to the pin. If your talking about Configuration words in the PICmicro configuration window. Then the value is 0x3FF4.
And Yes I tried creating a simple program just outputting a 1 and I got the same results.

Ondra

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Ondra »

Good day Benj and medelec35 any of you got any further thoughts on this issue.

Ondra

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Benj »

Hello Ondra

I have one thought but you may not like it.

Throw the 12F683 in the bin and use a 16F88, they must be almost as cheap and they are a lot more reliable out in the field.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC12F683 AN3 not going low

Post by Benj »

Hello Ondra

I have just tested a 12F683 device here on the matrix EB006 v7 board.

I used configuration setting 0x3ff4 and simply toggled the output on pin GP5 every second.

I then moved the OSC / A6&7 jumper to the A6&7 setting to disconnect the oscillator from the device pins.

The output for the GP5 pin is connected through to RA7 so I connected a LED E-Block to PortA and pin 7 is toggling correctly.

The output voltage is registered on my multimeter as 0V and 4.72V.

The main reason for my comments above is that the devices are quite unreliable when you are trying to reprogram them. IE they seem to break very easily. Therefore if you are designing application boards for a product then you may very well save time, money and hair by going for a device such as the 16F88.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PIC12F683 AN3 not going low

Post by medelec35 »

Im with ben on this one. Config appears to be ok. You can really go wrong using flowcode and correct config. So doggy 12F683.
Martin

Post Reply