Page 1 of 1

progamming pic 16F628A

Posted: Mon Sep 18, 2017 8:55 pm
by greenant
Hello,
I am using Flowcode 6 pro. in which I have written a progam which when I simulate it runs fine, however if download the program into the chip
(pic16F628A) it doesn"t work. I using EB006-7 programmer. What can I be Doing wrong.

Re: progamming pic 16F628A

Posted: Mon Sep 18, 2017 9:11 pm
by medelec35
Hi greenant, It's probably your configuration settings?
You have not given us any information to help.
Can you post a flowchart and let us know if using a crystal or internal oscillator?
Do you get any error messages or do you get compiled successfully message?

Re: progamming pic 16F628A

Posted: Mon Sep 18, 2017 9:27 pm
by greenant
Hello medelec, I attached the flowchart,I am running the chip on internal osc.I didn't get any error massages it compiled succesfully. I got in the msg.file a warning that the macro mightnever been called. I ignored this because the simulation was working correct.
I hope you will be able to help me. regards greenant.

Re: progamming pic 16F628A

Posted: Tue Sep 19, 2017 10:12 am
by Benj
Hello,

Are you pulling the MCLR pin up to VCC via say a 10K - 100K resistor? Your config and clock speed otherwise look fine to me.

Re: progamming pic 16F628A

Posted: Tue Sep 19, 2017 10:55 am
by greenant
Hi Benj
I am testing the chip while it is in the programmer, according to the datasheet there is a 10k resister in the MCLR line.

Re: progamming pic 16F628A

Posted: Tue Sep 19, 2017 11:07 am
by QMESAR
I am testing the chip while it is in the programmer, according to the datasheet there is a 10k resister in the MCLR line.
This is very interesting in 12 years(I am working with PIC's) I never saw a programmer or a pic with a pullup in the MCLR line :shock:
Can you post this datasheet please for us to learn from it also !

Re: progamming pic 16F628A

Posted: Tue Sep 19, 2017 11:31 am
by medelec35
QMESAR wrote: I never saw a programmer or a pic with a pullup in the MCLR line
This is a practice I have seen often as MCLR and VPP can share the same pins.
You can't tie MCLR/VPP directly to 5V, yet you may want to use MCLR to reset if adding a reset switch.
Or if MCLR/VPP is also an input then you may want a pull up resistor.
@greenant is the 10K resistor in series with programmer VPP and MCLR or is the resistor going from MCLR of chip to +5V?

As mentioned recently:
What I always do before developing any new project is to set up a 1 second flash test.
Once the timing is correct, I start to develop my project.

Re: progamming pic 16F628A

Posted: Tue Sep 19, 2017 11:40 am
by QMESAR
@Martin

I agree 100% with you however I understood the OP post as the programmer has the Resistor fitted to the Programmer HW as standard equipment
and that is rareto me , I never saw that .(Normally you have to add the Pullup on your HW (example PICkit2/3 pinout)
The reason I am asking for his datasheet to see what programmer it is :D

I took it that he says from the datasheet of the programmer has a resistor already in line
here the OP copmment
I am testing the chip while it is in the programmer, according to the datasheet there is a 10k resister in the MCLR line.
:D

Re: progamming pic 16F628A

Posted: Tue Sep 19, 2017 4:25 pm
by greenant
Hi QMESAR'
I looked at the datasheet EB006-7 again and I see I made a mistake I was looking at the MCLRA and MCLRB multiplexing.
The reset pushbutton is connected to ground. I measered on pin A5 5VDC where that is coming from I cannot find on the datasheet.
As medelec suggested that I have to test the delay first I don't understand there the only delay I am using is in the macro (teller7P) and I don't
care if the delay is exactly 200ms or does that influence mij program.

Re: progamming pic 16F628A

Posted: Tue Sep 19, 2017 4:31 pm
by medelec35
Hi geenant,
The only reason for the test is to establish tat the hardware is running at the correct speed.
For example if you set the delay so after each second the LED changes state then if on the hardware LED changes faster or slower or not at all then you have an issue with the hardware running at the correct speed.

Once hardware is running at the correct speed, you can procedure to create your own flowchart.

Martin

Re: progamming pic 16F628A

Posted: Tue Sep 19, 2017 9:40 pm
by medelec35
Hi greenant
I have not got your target device so changed target to 16F1937 and it works ok for me.
You have not said what does not work.
Is it that LCD is not showing anything?

Re: progamming pic 16F628A

Posted: Wed Sep 20, 2017 10:15 am
by greenant
Hi meledec,
I also changed target to 16F877A and now everything is working. With the 16F628A I think the problem is that the I/O on port A are analogue,
however as soon as you address portA as I/O Flowcode automatically sets port A to I/O, I set the jumpers J18 and J19 to A6+A7 on EEB-006-7.
After downloading the program to the chip nothing is working, when I make A3 High A4 should become High too but it don't and when that is not working the rest of the program isn't also.What I do wrong I do not know maybe you know.
regards Rudolf

Re: progamming pic 16F628A

Posted: Wed Sep 20, 2017 1:33 pm
by medelec35
Hi Rudolf,
I have tried on a simulator which uses hex file and the 16F628A is working..
PortA is definitely set on digital.

Do you have another 16F628A you could try?

What I would do is to read the switches on port A and pass the value to port B just to test if they can be read from and written to.
It only takes a few icons within a loop.

I assume the 1 sec flash test was ok?

Martin

Re: progamming pic 16F628A

Posted: Thu Sep 21, 2017 2:44 pm
by greenant
Hi Martin
I don't have another 16F628A so I think I will go on with the 16F877A and because I want to extent the program with some more features which is
easy with the 16F877A because it has more I/O.
Anyhow thank you for your help, Rudolf.