PICs are acting weird

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

Moderators: Benj, Mods

Post Reply
User avatar
FCCHow
Posts: 27
Joined: Fri Jul 28, 2006 10:40 am
Contact:

PICs are acting weird

Post by FCCHow »

Hi, guys. First of all, Merry Christmas! I am not sure of this is the correct thread since the problem could either be Flowcode v3 or the v3 E-Blocks Multiprogrammer board. But this is a long one.

It seems that everytime I take out the e-blocks and the V3 multiprogrammer, something bad happens. This time its something I cannot fix. It all started when I used Flowcode 3.6.11 to program a simple 6 LED setup on Port A (EB0004001) which will sequence depending on the push button (EB0007001) on Port B. The Flowcode simulation works fine and when I 'compile to chip' on the EB-006-00-5, the LEDs did not respond to the push buttons. So, I dug out Microchip's PicstartPlus and programmed the PIC from the Flowcode's .asm file. And the result was even worse.

So, here are my observations and tests:
1) The Multiprogrammer pin have been set to J3(1/O Port), J12J13J14(USB), J29(PSU). As I am using a PIC16F628A-I/P , the XTAL and RC settings have no effect.
2) Settings to the chip are as follows:
Clock Speed at 4,000,000Hz
Ocsillator at INTOSC I/O
Watchdog Timer is OFF
Power up Timer is OFF
Brown out Detect is disabled
Master Clear Enable is Disabled
Low voltage Program is Disabled
Data EE Protect is Disabled
Code Protect is Disabled
Configuration word is 0x3F18 HEX
And it can autodetect the PICF628A
3) I changed the switch inputs from Port A to B and LEDs from Port B to A (and the relevant E-Blocks) but no effect.
4) I created a breadboard circuit with a 5volt DC supply and the result was the same
5) Tinkering with the timers (Watchdog or Power up or Mastre clear) only allows me to reset the chip via the reset button
6) I uninstalled and reinstalled the Flowcode from the DVD, and then upgraded to v3.6.11. Then I reinstalled PP3 v3.9 but the problem is still the same.
7) I bought a few more PIC16f628A thinking it was faulty and tried reprogramming again but there the problem still the same
8) A few months ago, I had the problem of the Multiprogrammer board not being able to recognise the PIC12F629. But after I tried compiling the Flowcode's .asm file in MPLAb and programming it to the Picstartplus, it works.
9) The power adaptor I have is rated at 13.5 volts DC at 1.5A.

I am really scratching my head on this one now just when I am really starting to learn more about the Software after so many years. So, this is a really weird problem for me. Just in case, I have submitted the file as well. I am not sure upgrading to Flowcode v4 would solve this problem since it has been working fine all along. (But I am very interested in the MIAC, though)

Thanks.
Attachments
6 LEDS.fcf
My Flowcode file to sequence 6 leds
(14.5 KiB) Downloaded 288 times
What can I take apart, today?

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: PICs are acting weird

Post by Steve »

You are using an internal oscillator configuration. I don't know off-hand what speed you chip will be in this situation, but it could be that you have not set the chip speed within Flowcode to be the same as the actual chip speed.

User avatar
FCCHow
Posts: 27
Joined: Fri Jul 28, 2006 10:40 am
Contact:

Re: PICs are acting weird

Post by FCCHow »

Dear Steve,

I have set it to run at 4MHz as this is the normal speed I do with the PCI16F628A. I have also tested other clock sources such as RC and XTAL and they're all gave me the same problem; the program will run fine and was able to "reset" the PIC after I enabled the Master Clear Enable. But it still does not accept any switch inputs, which is the main problem in the first place.
What can I take apart, today?

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: PICs are acting weird

Post by Benj »

Hello

Have you supplied the switch E-Block with a power signal. It needs a wire connection from the +V terminals on the multiprogrammer to the +v terminal on the switch E-Block to allow the 5V pull up resistors to work.

User avatar
FCCHow
Posts: 27
Joined: Fri Jul 28, 2006 10:40 am
Contact:

Re: PICs are acting weird

Post by FCCHow »

Dear Benj,

First and foremost, I would like to take this opportunity to wish you and everyone at Matrix a Happy New Year!

I have connected the power cable as suggested and frankly, I'm stumped. Maybe I am imagining things but I did remember the last time, previous projects responded well without that cable. The circuit is working fine now and this is the best start for the New Year! :mrgreen:
What can I take apart, today?

Post Reply