View previous topic :: View next topic |
Author |
Message |
FCP
Joined: 19 May 2010 Posts: 13
|
PIC16F73 to PIC16F737 |
Posted: Thu Nov 29, 2012 6:29 pm |
|
|
I am having problems programming a PIC16F737 to run code designed for a PIC16F73. Does anybody know what changes must be done to the source code to migrate the firmware ?
Note:
I could probably figure it out, but I am pressed for time. In their wisdom, our purchasing department, could not get the PIC16F73 on time and decided on their own to buy the PIC16F737. Now that the units produced are in testing, they are failing.
Thank you. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 29, 2012 8:10 pm |
|
|
Quote: | Now that the units produced are in testing, they are failing. |
1. What are the boards supposed to do, and what features are failing to
work properly ? For example, is the RS-232 failing, or the A/D, or
the PWM, or it just failing to compile without errors ? Give details.
Note that the 16F73 has an 8-bit A/D but the 16F737 has a 10-bit A/D.
2. What is your compiler version ?
3. What is the Vdd voltage on the PIC ?
4. Are you compiling the program in Debug mode, or in Release mode ?
5. How are you testing it ? Are you running it with an ICD debugger
or are you running it in Standalone mode (ie., the same as the customer
would run it) ?
6. What is the frequency of the external crystal or oscillator ?
7. Do you have a bypass capacitor (Ceramic, 100 nF) placed very close
to the Vdd pin on the PIC ? The 16F737 probably has a smaller die
compared to the 16F73 and will likely be more sensitive to lack of
proper bypassing on the Vdd pin. You need the cap on the Vdd pin
(between Vdd and ground). |
|
![](templates/subSilver/images/spacer.gif) |
FCP
Joined: 19 May 2010 Posts: 13
|
|
Posted: Fri Nov 30, 2012 8:59 am |
|
|
1. The application is an LED display board, and the actual failure is related to the activation of the display matrix. I do have indicator LED's which are working properly (mostly heartbeat and communication enabled).
2. Latest compiler version by CCS.
3. 5 VDC.
4. Release mode.
5. Programming an IC and running it in the application PCB.
6. ~7.3 Mhz.
7. All the coupling and oscillator capacitors are in place.
Apparently the micro is executing code, what I am afraid is that the original programmer relied in the default values of IC setup and it worked fine, and with the change of component it will require to do the setup "manually" due to the added functions at each pin. |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Nov 30, 2012 9:50 am |
|
|
Quote: | 2. Latest compiler version by CCS. | Today v4.139 was released. I doubt you are using that version.
Always post the exact version number so we can be sure to be testing with the same version you are using.
Quote: | Apparently the micro is executing code, what I am afraid is that the original programmer relied in the default values of IC setup and it worked fine, and with the change of component it will require to do the setup "manually" due to the added functions at each pin. | Very likely it is something like that, but those problems are easy to fix a with a small software change. I don't have time now but will have a look into it later, unless someone else responds here sooner. |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Fri Nov 30, 2012 1:11 pm |
|
|
i think PCM gave good advice.
post all the code you can especially header and fuses
but really all you can so evaluation becomes possible. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Nov 30, 2012 2:42 pm |
|
|
Quote: |
what I am afraid is that the original programmer relied in the
default values of IC setup
|
1. Did the original programmer let the CCS "Wizard" insert the i/o setup
code ? Post the setup code which normally appears at the start of main().
Post the #fuses, #use delay(), all #use statements.
2. Post a list of the i/o pins you're using for the LED display board.
3. If the LED display board is a purchased component, post the
manufacturer and part number and a link to the webpage for it.
Quote: |
Latest compiler version by CCS.
|
4. What compiler version did the original programmer use ? Surely not
the latest one. There were important changes done between versions
that can cause older programs to fail if compiled with a new compiler.
If we know the original version and your current version (exact number)
then we can tell you what to look for in your code. |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Fri Nov 30, 2012 2:59 pm |
|
|
because it is intermittent - have you checked the brownout voltage selection for the 737 ??
And you are sure the ADC 8 bit vs 10 bit thing is not biting you ? |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Nov 30, 2012 3:02 pm |
|
|
As indicated by the other people in this thread we can only give exact when we know more details, but there is one very likely culprit that you can have a look at:
The PIC16F737 has more functions, some of which override the functions that are enabled on the PIC16F73. Especially the PIC16F737 has more analog inputs and these are all enabled at power up and that will block all other activities on the Port B0 to B5 pins.
When your code contains: Code: | setup_adc_ports(NO_ANALOGS); | then the compiler will configure this correctly for both processors. However, when you are directly writing to the ADCON1 register than the configuration for the other processor will leave B0 to B5 configured as analog inputs.
Too bad your purchasing department did choose another PIC that is even more expensive than the original.
The PIC16F73 is so basic that many of the newer and cheaper models would fit the requirements. |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sat Dec 01, 2012 7:46 am |
|
|
there is a worse thing than when/if purchasing decides on components though. Its when SALES makes the call instead ;-(( |
|
![](templates/subSilver/images/spacer.gif) |
|