interrupt timer0 + winpic800 = pic problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
prof_STI
Flowcode V4 User
Posts: 4
Joined: Thu Jan 28, 2010 4:04 pm

interrupt timer0 + winpic800 = pic problem

Post by prof_STI »

Hello,
I have a problem with using the timer interrupt 0,
Here is my setup: Flowcode 4.2 Winpic800, JDM programmer all under Windows XP.
The program blocks my pics and I can no longer recover, it is as if the fact of the program influenced the "Code Protection". Once programmed, you can not regain access to my pics (I flashed 6 that I consider to be lost).

I of course made many tests and only this code blocked me my pics ...

I attach the file in question, may be you detect a flaw? or better yet a solution.

Thank you in advance
PB_2_7_SEG.fcf
(21.37 KiB) Downloaded 253 times

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

Re: interrupt timer0 + winpic800 = pic problem

Post by medelec35 »

I believe I have spotted a problem. It looks like you wanted DECODAGE set up as an array, but you have set it up as a string. Not got a lot of time at the mo, but I have change DECODAGE to an array for you. If im wrong then please let me know.
However if that is the case then when you have got DIZAINES_MINUTES=10, array does not go up to 10.
Another thing is your LED display you have set up to display only parts of a segment and not a whole number e.g only a 1/7 of your display will light at a time. You have not use the LED segment component macro.
Unless you have been cleaver and the segments light so quickly it looks like a whole number. I don't believe that will work in this case, but I could be wrong in the short time I have had to look at your code.
Attachments
PB_2_7_SEG1.fcf
(21.51 KiB) Downloaded 264 times
Martin

prof_STI
Flowcode V4 User
Posts: 4
Joined: Thu Jan 28, 2010 4:04 pm

Re: interrupt timer0 + winpic800 = pic problem

Post by prof_STI »

good evening,

Thank you for taking the time to look at my code, I change but it still does not change anything to my worries.

Indeed, the idea of the array was not good, I recoded all for the same thing differently in the program No. 3.

Step 1: To simplify things, I made a diagram in Isis and simulate (see image attached). it is a multiplexed display and simulation shows me that everything works the way I want.

Step 2: Programming Winpic -> OK

Step 3: Reading and access to my pic ---> Problem impossible to access and appearance of the message "UNKNOWN" instead of my pic "16F877", and there is drama, not read , write, erase ... pic is dead.

I put some in the Attachment screen printing as well as the source file.

Thank you
Attachments
PB_2_7_SEG3.fcf
code
(27.32 KiB) Downloaded 243 times
WINPIC800 VIEW
WINPIC800 VIEW
wpinterpb.JPG (75.78 KiB) Viewed 5050 times
ISIS VIEW
ISIS VIEW
isisinterpb.JPG (40.83 KiB) Viewed 5050 times

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

Re: interrupt timer0 + winpic800 = pic problem

Post by Steve »

It sounds like this could be a configuration word problem, or an issue with your programming software/hardware.

prof_STI
Flowcode V4 User
Posts: 4
Joined: Thu Jan 28, 2010 4:04 pm

Re: interrupt timer0 + winpic800 = pic problem

Post by prof_STI »

Perhaps indeed, but the configuration word (0x3D3A) that I use is the same for years, I've never had problems with. Same with my software configuration winpic and my card test. It works for 2 years without problems. The problem presented appeared with flowcodeV4.2 and use of interrupts. after "killing" 8 pics, I quit my tests.
For the moment I see no alternative but to make a program in C or without interruptions.
This may be a programming error but I can not find it. That's why I post here on the forum.

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

Re: interrupt timer0 + winpic800 = pic problem

Post by Steve »

Are these chips 16F877 or 16F877A. There is a difference with the config settings for these chips.

We do not have access to the programmer you are using, so it is difficult to test here. If you believe that these chips are truly "dead", then you could perhaps send one to us and we may be able to see what the problem is. (if you do choose to send a chip to us, make sure you reference this topic so that I know what the issue is).

The config setting in the FCF file looks ok. You could post the HEX file here if you like and I'll check the code in that one too.

prof_STI
Flowcode V4 User
Posts: 4
Joined: Thu Jan 28, 2010 4:04 pm

Re: interrupt timer0 + winpic800 = pic problem

Post by prof_STI »

Hello

To find a track to our problem, we will summarize the work and tests undertaken and problems encountered.

PROJECT AND SOLUTIONS DEDUCTIONS:

The project is to improve an underwater scooter offering a view of autonomy.
Constraints:
  • 1) Manage the securities
    2) Manage speeds via 2 joysticks.
    3) Measure the battery voltage, calculate and display autonomy.
Part of the project is to measure a voltage via the ADC PIC to calculate the autonomy of a battery, then the result is displayed on a LCD module, or 3 on 7-segment displays.
Another section of the program involves the management of orders and handles the increment or decrement the speed of an engine via the PWM module.
The management of securities is done on monitoring the logic level at the pin.

We decided to take a measurement every 10s that involves the use of an interruption by the timer 0. Monitoring of joysticks and various securities is made continuous.

Here is our procedure for the project:
  • 1) Draw the flowchart under FC4
    2) Compilation under Flowcode with the following parameters: configuration word: 0x2007, 0x3d3a
    3) Simulation in Isis v6.9 for confirmation before programming
    4) Programming a 16F877 PIC with winpic800 and JDM local version programmer
    5) Wiring of different elements in the model of programming and verification.

THE PROBLEM:

The program with the LCD display works perfectly (simulation and programming). This program uses an interruption with the "Timer 0.

The simulation program with 7-segment display works properly, but it would appear that using an interruption timer 0 with multiplexed 7-segment displays causes a bug on the PIC. Indeed, the PIC is programmed correctly (no error message), but while trying to reprogram our WINPIC programmer can no longer identify the PIC and thus can neither read nor delete nor reprogram -> PIC becomes unusable and is good for the trash! (Also, to be sure of the quality of PIC, we used a component that had been programmed with the LCD program and presented no problem).

YOU CAN HELP:
  • 1) Retrieve files
    2) Check if necessary (but I do not think there are errors)
    3) Programming a device with your own programmer
    4) Try to re-enter the PIC (reading, writing)
    5) Confirm or overturn our problem
    6) Provide solutions for resolution ...
FILES PROVIDED:

The program PB_2_LCD.fcf : project with LCD display -> works and does not block PIC
The program PB_2_7_SEG2.fcf : project with multiplexed 7 segment display -> works but blocks the PIC read / write.
The hexa file PB_2_7_SEG2.hex :

Thank you in advance for your attention and your help.
PB_2_LCD.fcf
(28.75 KiB) Downloaded 275 times
PB_2_7_SEG2.fcf
(28.63 KiB) Downloaded 282 times
PB_2_7_SEG2.hex
(5.87 KiB) Downloaded 251 times

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: interrupt timer0 + winpic800 = pic problem

Post by Benj »

Hello

Ok I have had a look at your program running on a 16F877 device.

I changed the configuration to 0x3f3a and managed to successfully program and reprogram the device several times on an EB006.

I then changed the configuration to 0x3d3a and this also worked correctly multiple times.

I then compared the hex file that my Flowcode is generated with the hex file you posted up and they are identical.

I found a thread here that describes similar problems with programming 16F877 using WinPic.

http://www.rcgroups.com/forums/showthread.php?t=370001

Maybe a EB006 programmer is in order :)

Post Reply