Compiling to chip problem
Moderator: Benj
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Compiling to chip problem
Hi,
I am trying to compile a project to a PIC16F887. The project runs fine on simulator but when I try to compile to chip and try it on my hardware then the display starts showing random characters. Also all the letters and numbers that should be on the display have all moved to the right of the display. The project has been posted on this forum (Burr-Brown PGA2310 Preamplifier) and the member of this forum who put this project together assures me that it works with no problems or errors on his hardware. The display I am using is a Noritake - Itron VFD display, I have also tried an LCD display and that also won't work with my hardware.
Has anyone else experienced this problem?
Thank You
Phil
I am trying to compile a project to a PIC16F887. The project runs fine on simulator but when I try to compile to chip and try it on my hardware then the display starts showing random characters. Also all the letters and numbers that should be on the display have all moved to the right of the display. The project has been posted on this forum (Burr-Brown PGA2310 Preamplifier) and the member of this forum who put this project together assures me that it works with no problems or errors on his hardware. The display I am using is a Noritake - Itron VFD display, I have also tried an LCD display and that also won't work with my hardware.
Has anyone else experienced this problem?
Thank You
Phil
- DavidA
- Matrix Staff
- Posts: 1076
- Joined: Fri Apr 23, 2010 2:18 pm
- Location: Matrix Multimedia Ltd
- Has thanked: 58 times
- Been thanked: 258 times
- Contact:
Re: Compiling to chip problem
Hi Philip,
the most common issue with simulation working and not in hardware are the config and clock settings. Have you tried creating a 1s flasher and making sure that the timing works correctly for your hardware?
the most common issue with simulation working and not in hardware are the config and clock settings. Have you tried creating a 1s flasher and making sure that the timing works correctly for your hardware?
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Re: Compiling to chip problem
Hi David
Thanks for your reply
I've just tried what you have suggested and it works on either fc4 or fc5 simulator, but it won't work on hardware. I am using PPPv3 and an EB006 multiprogrammer. After compiling to chip it does say compiled successfully and it shows how many words I've used and how much there is available.
Phil
Thanks for your reply
I've just tried what you have suggested and it works on either fc4 or fc5 simulator, but it won't work on hardware. I am using PPPv3 and an EB006 multiprogrammer. After compiling to chip it does say compiled successfully and it shows how many words I've used and how much there is available.
Phil
- 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: Compiling to chip problem
Hi Phil,
Sounds like you are compiling to hex. When you compile to chip you should get a confirmation message that the chip has been programmed correctly.
Are you using the right crystal on your hardware? You can check this by going into the Flowcode project options window and checking the clock speed matches your crystal value - normally 19660800 on the EB006.
Next you can check your configuration settings. These should be something along the lines of:
Oscillator - HS
Watchdog - Disabled
Extended CPU - Disabled
Low Voltage Programming - Disabled
Sounds like you are compiling to hex. When you compile to chip you should get a confirmation message that the chip has been programmed correctly.
Are you using the right crystal on your hardware? You can check this by going into the Flowcode project options window and checking the clock speed matches your crystal value - normally 19660800 on the EB006.
Next you can check your configuration settings. These should be something along the lines of:
Oscillator - HS
Watchdog - Disabled
Extended CPU - Disabled
Low Voltage Programming - Disabled
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Re: Compiling to chip problem
Hi Benj
Thanks for your reply.
For the project I am trying to compile to hex there is no crystal on my hardware. I am using the internal oscillator that is inside the 16F887. If look in project options the clock speed is set at 4000000Hz. I will check my configuration settings to see if they match what you have put down in your post
Thanks
Phil
Thanks for your reply.
For the project I am trying to compile to hex there is no crystal on my hardware. I am using the internal oscillator that is inside the 16F887. If look in project options the clock speed is set at 4000000Hz. I will check my configuration settings to see if they match what you have put down in your post
Thanks
Phil
- fotios
- Posts: 458
- Joined: Mon Feb 08, 2010 10:17 am
- Location: Greece
- Has thanked: 109 times
- Been thanked: 117 times
Re: Compiling to chip problem
Hi BenBenj wrote:Hi Phil,
Sounds like you are compiling to hex. When you compile to chip you should get a confirmation message that the chip has been programmed correctly.
Are you using the right crystal on your hardware? You can check this by going into the Flowcode project options window and checking the clock speed matches your crystal value - normally 19660800 on the EB006.
Next you can check your configuration settings. These should be something along the lines of:
Oscillator - HS
Watchdog - Disabled
Extended CPU - Disabled
Low Voltage Programming - Disabled
I think you have perceive that the project is mine. We have exchanged lot of successive direct e-mails with Philip to solve the problem. Philip has the student version of FCv4 and FCv5, so though can run on simulator the project he can't compile directly within FlowCode. He is forced to use the PPP compiller to program directly on hex. i posted him the hex file generated from my FCv5, but Phil had issues with printing on VFD display. Characters are not printed on the right x-y coordinates, also spurious characters are printed, i saw it in photos Philip sent me. I had a thought maybe hex file corrupted thru e-mail and i asked Phil to post me back it. I compilled the e-mailed hex file directly with PPP and the result was correct. I have tried this file lot of times (the same Phil) on simulator, e-blocks and on actual hardware and never I had issues with LCD display printing. Philip has problems only with his VFD display, everything else is working correct. It should be noted that the project code is too big, it takes up a 90% of P16F887 program memory.
Configuration settings are correct, when open the hex with PPP it shows this on "Config Screen".
I attach the hex file to take a look on configuration.
Philip checked and rechecked his hardware connections, he posted me photo, they seems to be correct. In my project thread i have posted enough upgrades (no corrections, additional functions) and Philip had no one problem with the early fcfs which were not so long (up to 60% of program memory).
Now not only Philip, but also me I am "short-circuited". I repeat, problem is wrong printing on Phil's VFD display. Me, I haven't any problem with my LCD display, everything is printed correctly.
Ben, you could help us a bit by compilling the fcf on your e-blocks? You have just to connect the LCD board in Port.A and switch board in Port.B of EB006. Though i have enabled internal pull-ups of Port.B and I know that e-blocks switch board is active HIGH. You can delette the "option_reg.NOT_RBPU = 0;" C command at the beginning of Main Loop to be compatible with the HIGH states of e-block switch board. Then simply check if characters are printed in right x-y coordinates.
I also attach the fcf file.
Thanks
- Attachments
-
- PGA2310_GUGLIELMO.hex
- (38.34 KiB) Downloaded 318 times
-
- PGA2310_GUGLIELMO.fcf
- (231.63 KiB) Downloaded 305 times
Best Regards FOTIS ANAGNOSTOU
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Re: Compiling to chip problem
Hi Benj,
After looking through my configuration settings I cant seem to find the "Extended CPU" option, maybe I've missed it within the config options.
Thanks Fotis for describing the problem that I am experiencing, you described the problem exactly. When I swapped the VFD for a LCD display the problem is worse, I only get a line of blocks across the top row of the display.
Thanks again
Phil
After looking through my configuration settings I cant seem to find the "Extended CPU" option, maybe I've missed it within the config options.
Thanks Fotis for describing the problem that I am experiencing, you described the problem exactly. When I swapped the VFD for a LCD display the problem is worse, I only get a line of blocks across the top row of the display.
Thanks again
Phil
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Re: Compiling to chip problem
Hi,
I've been trying to get the VFD display to work on this project but still no joy. Can you point me in the right direction as far as the configuration setting are concerned?
The project uses a PIC16F887 and is set to use it's internal oscillator. I am using the EB006 programmer and I have just upgraded to FC v5 professional. Any help would be very much appreciated
Thanks
Phil
I've been trying to get the VFD display to work on this project but still no joy. Can you point me in the right direction as far as the configuration setting are concerned?
The project uses a PIC16F887 and is set to use it's internal oscillator. I am using the EB006 programmer and I have just upgraded to FC v5 professional. Any help would be very much appreciated
Thanks
Phil
-
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: Compiling to chip problem
One suggestion which may or may not be helpful?
If you have a frequency meter, set chip confing to Internal RC Clockout
Measure the frequency at pin RA6 (CLKOUT) (make sure pin is not connected to any thing that could short it e.g switch)
The frequency should be 4MHz/4 = 1MHz
I did have a few 16F883 (same family) that was out of the 2% tolerence.
Had to use osctune in C to adjust frequency which worked well.
If it is out I can help you with that command.
I don't think its worth going further until frequency is checked and correct.
Martin
If you have a frequency meter, set chip confing to Internal RC Clockout
Measure the frequency at pin RA6 (CLKOUT) (make sure pin is not connected to any thing that could short it e.g switch)
The frequency should be 4MHz/4 = 1MHz
I did have a few 16F883 (same family) that was out of the 2% tolerence.
Had to use osctune in C to adjust frequency which worked well.
If it is out I can help you with that command.
I don't think its worth going further until frequency is checked and correct.
Martin
Martin
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Re: Compiling to chip problem
Hi Martin
Unfortunetly I don't have a frequency meter to mesure the frequency at pin RA6. Is there another way to check pin RA6?
Thanks
Phil
Unfortunetly I don't have a frequency meter to mesure the frequency at pin RA6. Is there another way to check pin RA6?
Thanks
Phil
- fotios
- Posts: 458
- Joined: Mon Feb 08, 2010 10:17 am
- Location: Greece
- Has thanked: 109 times
- Been thanked: 117 times
Re: Compiling to chip problem
Hi Phil
Please give a try in the attached fcf file.Configuration settings for P16F887 are the same like in the original project (INTOSC = 4MHz, MCLR = Internal etc.). I have tried it on actual hardware with success. Open it with FC5 professional. It simply prints your name "PHILIP DAVIES" alternately in first line and in second line. Firstly run it on simulator to get an idea. Then compile it on the actual 16F887 and run it on actual hardware. If it prints without errors on VFD or LCD, then the internal oscillator module of micro is OK.
Please let me know.
Please give a try in the attached fcf file.Configuration settings for P16F887 are the same like in the original project (INTOSC = 4MHz, MCLR = Internal etc.). I have tried it on actual hardware with success. Open it with FC5 professional. It simply prints your name "PHILIP DAVIES" alternately in first line and in second line. Firstly run it on simulator to get an idea. Then compile it on the actual 16F887 and run it on actual hardware. If it prints without errors on VFD or LCD, then the internal oscillator module of micro is OK.
Please let me know.
- Attachments
-
- 16F887_LCD_test.fcf
- (8 KiB) Downloaded 273 times
Best Regards FOTIS ANAGNOSTOU
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Re: Compiling to chip problem
Hi Fotis
I've just tried the fcf file and it works on my hardware with no problems. it does exactly the same as simulator and times exactly the same.
Thanks
Phil
I've just tried the fcf file and it works on my hardware with no problems. it does exactly the same as simulator and times exactly the same.
Thanks
Phil
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Re: Compiling to chip problem
Hi
I think I've found the problem that caused the display to show randome characters. In the configuration settings I turned the "Power Up Timer" to ON instead of leaving it OFF. This seems to get the project working with no errors
Thanks for all your help
Phil
I think I've found the problem that caused the display to show randome characters. In the configuration settings I turned the "Power Up Timer" to ON instead of leaving it OFF. This seems to get the project working with no errors
Thanks for all your help
Phil
- fotios
- Posts: 458
- Joined: Mon Feb 08, 2010 10:17 am
- Location: Greece
- Has thanked: 109 times
- Been thanked: 117 times
Re: Compiling to chip problem
Hi Phil
Yes, you are right. I just looked on configuration settings and indeed i had disabled the POR reset, while at the same time i had and the MCLR disabled (for use as digital input). The thing is some strange. I have a second fcf with extension "test" that i used with E-blocks and EB006 programer to test the project. This second file is exactly the same, simply in configuration the MCLR is enabled (to use the reset switch of EB006) and the POR disabled. In both fcf the BOR is enabled (it scans if the Vdd falls below 4V and causes internal reset of micro). In the actual project, realy i don't remember which of the two fcf i used to program the 16F887. I remember that i had no one issue. I also have confirmation that the micro works just fine from the guy in which i sold the control board!
Maybe it is an issue of power supply, i don't know.
Anyway, i am happy that you resolved the problem. I was ready to post you a programed 16F887!
Yes, you are right. I just looked on configuration settings and indeed i had disabled the POR reset, while at the same time i had and the MCLR disabled (for use as digital input). The thing is some strange. I have a second fcf with extension "test" that i used with E-blocks and EB006 programer to test the project. This second file is exactly the same, simply in configuration the MCLR is enabled (to use the reset switch of EB006) and the POR disabled. In both fcf the BOR is enabled (it scans if the Vdd falls below 4V and causes internal reset of micro). In the actual project, realy i don't remember which of the two fcf i used to program the 16F887. I remember that i had no one issue. I also have confirmation that the micro works just fine from the guy in which i sold the control board!
Maybe it is an issue of power supply, i don't know.
Anyway, i am happy that you resolved the problem. I was ready to post you a programed 16F887!
Best Regards FOTIS ANAGNOSTOU
-
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: Compiling to chip problem
That is a handy tip to knowphilip davies wrote:Hi
I think I've found the problem that caused the display to show randome characters. In the configuration settings I turned the "Power Up Timer" to ON instead of leaving it OFF. This seems to get the project working with no errors![]()
This forum benefits from any useful information users update us with when a problem is solved.
Thanks Phil.
Martin
Martin
-
philip davies
- Flowcode v5 User
- Posts: 118
- Joined: Wed Jun 29, 2011 1:09 pm
- Has thanked: 17 times
- Been thanked: 6 times
Re: Compiling to chip problem
Hi
No problem Martin, thought I would post on here that I managed to solve the problem. I forgot to mention that I am not using an external PSU for my EB006 programmer, I'm only using power from the USB socket on my laptop.
Thanks Fotis, that was very kind of you for willing to post me a ready programmed mcu of your project if I couldn't get the problems sorted. I managed to add the EQ function to the preamp and I have just managed to add the headphones on/off function to it
I can post this on your project thread if you like. i have yet to try the extra two functions on actual hardware
Anyway thanks for your time and patience
Phil
No problem Martin, thought I would post on here that I managed to solve the problem. I forgot to mention that I am not using an external PSU for my EB006 programmer, I'm only using power from the USB socket on my laptop.
Thanks Fotis, that was very kind of you for willing to post me a ready programmed mcu of your project if I couldn't get the problems sorted. I managed to add the EQ function to the preamp and I have just managed to add the headphones on/off function to it
Anyway thanks for your time and patience
Phil