Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - pic12f675 gp2 issue

(you are viewing a thread; or go back to list of threads)

pic12f675 gp2 issue (by Frank)
Hi Guys, i got a little project were im using gp5 and gp2 as inputs...On power up gp5 is low but gp2 is high ..? have changed the status of the pullups in the settings section and also checked the asm file and its disabling the analog inputs...Has anyone got any idea what im may be doing wrong ? Cheers Frank
Wed Sep 15 2021, 21:00:07
(no subject) (by MGP)
I use the 12F675 a lot and everything works fine.
But on powerup, all IOs are switched as inputs until the program runs and therefore I don't understand your question properly.
Post an example (.LD)
Thu Sep 16 2021, 02:05:03
(no subject) (by Frank)
I mean its programmed as an input but the pin is high as if its pullup was enabled..Have attached the ld file...
Thu Sep 16 2021, 04:13:04, download attachment Oven_Opener2.ld
(no subject) (by MGP)
I still don't understand your problem, is your input not connected to a circuit?

Unconnected inputs are not defined and can take either state.
An Unconnected input can also oscillate .

I even wonder how do you measure whether your input is high or low?
Thu Sep 16 2021, 06:55:27
(no subject) (by Frank)
it is connected it even has a pull down resistor but its sitting high for some reason ..it should be low !!! im using a socket for the ic and bent the pin at right angle to ensure it wasnt getting 5v from something else....i measure using a multimeter on the pin ....how do you measure your pins ?
Fri Sep 17 2021, 01:55:53
(no subject) (by MGP)
If I have time today I'll test that.

With a pull down or a pull up resistor you can measure this
with a multimeter, with an open pin you cannot measure that because the meter then becomes the pull up/down resistance.
Fri Sep 17 2021, 02:29:34
(no subject) (by Calubert)
Some questions to know what error it has so I can understand it.

1st This happens on the pcb (PCB = printed circuit board) and / or in the LDMicro simulator.

2nd in which legs of the pic12fxx you place the oscillator (Crystal).
I set you to MOVE to if you do the internal oscillator (Note you must look at the pic16fxx tab to see the records)
You will see that I put you PUL-daun, in the ladder diagram.

Do you change the input leg for another leg example: GP5 x GP4 in the LDMICRO program?

I modified your program, try it

please tell me if it worked for you

Unas preguntas para saber que error tiene para yo entenderlo.

1º Esto sucede en la pcb (PCB = placa de circuito impreso) y/o en el simulador LDMicro.

2º en que Patas de la pic12fxx colocas el oscilador (Cristal).
te puse MOVER para si haces el oscilador interno (Nota debes mirar la ficha del pic16fxx para ver los registros )
veras que te puse PUL-daun, en el diagrama escalera.

¿ cambia la pata de entrada por otra pata ejemplo: GP5 x GP4 en el programa de LDMICRO.?

te modifique tu programa pruébalo

por favor dime si te funciono
Fri Sep 17 2021, 06:15:29, download attachment Modificado.ld
(no subject) (by Calubert)
Attached in LDMicro how to do the pull-ups.
You will see that there are 2 parts of the program and it is made to simulate it in LDmicro, the upper part is with pull-ups in LDMicro programming and the lower part you have to place the pull-ups on the PCB. Note in the pic12f6xx you use you can set all the internal pull-ups ports in the pic.

Adjunto en LDMicro como hacer los pull-ups.
veras que hay 2 partes de programa y esta hecho para simularlo en LDmicro, la parte superior son con pull-ups en programación LDMicro y la parte inferior tienes que colocar los pull-ups en la placa PCB. Nota en el pic12f6xx que utilizas se pueden ajustar todos los puertos pull-ups internos en el pic.
Fri Sep 17 2021, 06:34:42, download attachment Prueba.ld
(no subject) (by Frank)
Hi Calubert...

1:Happens on the pcb, also on another pcb

2:im using the internal oscillator

Gp5 is functioning properly ,i have external pulldown resistors.
GP2 also has an external pulldown resistor ,but its being held high...

In ldmicro settings i have changed the value of pullups from 0xff to 0x00 no change ....

Also i tried your code ,still sitting hi without any button presses..thanks for your help
Fri Sep 17 2021, 17:35:44
(no subject) (by Frank)
Hi Calubert ,can you please explain what the move instruction at the top is doing ? thanks
Fri Sep 17 2021, 19:05:19
(no subject) (by Frank)
Hi guys i,checked my hardware and realised i had left off the pulldown on that input..installed a 10k resistor, now when i power up the board it doesnt activate the relay but if i probe the input connection with a multimeter it triggers the relay which the input pin is controlling, the voltage on the input pin gp2 is sitting at 1.9v ??...i tried disabling the pullups, see ld program...and then i noticed in the option register that gp2 was defaulted tmr0 clock src , so i set the bit low and now its working fine !!!...thanks for all your help guys!!! much appreciated..
Sat Sep 18 2021, 00:56:44, download attachment Oven_Opener2.ld
(no subject) (by MGP)
It looks like the GPPU bit doesn't change if you enable or disable the Weak pullups in the editor.

You can turn them on if you write 0xFF in address #0x95(WPU register) and turn them off if you write 0x00 in it with the MOV instruction.
I have tested this and it works well and it works also if you change the GPPU bit in adres 0x81.

The weak pullup resistors are current sources of ~200µA and if you connect a 10k resistor to the GND there will be about 2V across that resistor.
If you're using a 1k resistor, there's 0.2V across that resistor if you don't disable the pullup resistors.

That's why I always use 2k2 pulldown resistors in case I forget, but in most cases I use the pullup resistors.
Sat Sep 18 2021, 11:21:14, download attachment Oven_Opener3.ld
(no subject) (by Frank)
Hi MGP...thanks for the feedback , i unfortunately cannot open your file..im using 5.4.0.4 of ldmicro , i have updated to 5.4.1.1 but still cant open your file...thanks
Sat Sep 18 2021, 17:58:54
(no subject) (by MGP)
Strange, I use also version 5411.

Does anyone else have this problem too?
Attached the modified program.
Sun Sep 19 2021, 02:03:17, download attachment Oven_Opener3.ld
(no subject) (by Calubert)
I put it for you to place the values of the crystal (quartz), but I left it open circuit in case you had the external oscillator (let's say it is to place the bits for the oscillator.

I have seen that the S, R MGP already made you the internal oscillator bits in the Oven_Opener3.ld software

Te la puse para que colocaras los valores del cristal (cuarzo), pero la deje circuito abierto por si tenias el oscilador externo (digamos que es para colocar los bit para el oscilador.

he visto que el S,R MGP ya te hizo los bit del oscilador interno en el software Oven_Opener3.ld
Sun Sep 19 2021, 05:16:43
(no subject) (by Calubert)
If you look at the Test.ld, it is to save you external resistors.

They are the 1st lines (first group) without external resistors.
2nd lines are to place the external resistors.
With the internal resistors we did a lot of work when making the PCB circuits.
both in work and economic.

Si miras el Prueba.ld, es para ahorrarte las resistencias externas.

son las líneas 1º (primer grupo)sin resistencias externas.
2º líneas son para colocar las resistencias externas
Sun Sep 19 2021, 05:27:05
(no subject) (by calubert)
If it works, I use version 32-5.5b (from fransua), for now I open all of them so far.

Si funciona el yo utilizo versión 32-5.5b (de fransua), yo de momento abro todos hasta ahora.
Mon Sep 20 2021, 03:51:14
Oven_Opener3_working!! (by Frank)
Hi MGP tried your second version of oven_opener3 and it works fine...thanks a lot !!...So i didnt need to alter the bit in the option register ..?? Thanks guys!!
Tue Sep 21 2021, 02:12:30
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):