PIC16F88 vs PIC16(L)F88
Moderator: Benj
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
PIC16F88 vs PIC16(L)F88
Getting a bit desperate now!! - I wonder if someone could help. I need to use the PIC16(L)F88's for my application (hardwired UART Tx/Rx) which uses a 3v supply but they simply wont work, even after trying new ones. General opinion seems to be that the (L)F88 will programme and operate in the same way as the F88. However, I have spent many hours trying to do this with a lot of help from the forum, web and data sheets but the LF88's have refused to co-operate so yesterday, I purchased a couple of F88's, dropped them in and they work perfectly! I had been in touch with Matrix Multimedia a while ago because my Flowcode v4.3 does not have the LF88 listed but it was thought that using the F88 would work ok. Unfortunately they don't. I understand that Flowcode v5 DOES include the LF88 but I can't afford to upgrade. There must effectively be SOMETHING different about the Flowcode programming, for it to be included as a dedicated device in v5. I wonder if Matrix Multimedia could throw some light on this as they are the best people to know what they needed to do for incorporation into Flowcode v5 and how I can apply whatever is required to use the PIC16LF88's in this application.
Many thanks in advance,
Chris
Many thanks in advance,
Chris
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Hi Chris,
What oscillator mode are you using? When looking at the 16(l)f88 data sheet page 165 (chapter 18.1) in the conditions column it states "HS, XT, RC and LP Oscillator mode" for the LF version. If you are using the new (according to page 35) modes RCIO, INTIO1, INTIO2 or ECIO that might explain why things do not work.
Best regards,
Jac
What oscillator mode are you using? When looking at the 16(l)f88 data sheet page 165 (chapter 18.1) in the conditions column it states "HS, XT, RC and LP Oscillator mode" for the LF version. If you are using the new (according to page 35) modes RCIO, INTIO1, INTIO2 or ECIO that might explain why things do not work.
Best regards,
Jac
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Hi Jac,
Thanks for your posting. I am just a beginner in all this so I don't understand all of the implications with settings and data but I am using the INTERNAL oscillator as mentioned on page 37 section 4.5 'Internal Oscillator Block'. If you then go to page 40 and see the bit setting parameters for OSCCON including '110' for 4MHZ the binary - as I saw it at the time - became 01100000 which is Hex 60. So The Tx and Rx flowcharts start with a C block that is "osccon=0x60;" to set up the oscillator. That seems to work fine with the F88. However now I look at it again I'm not sure about bits 3 to 0 and whether that is significant for the (L)F88. What do you reckon?
Chris
Thanks for your posting. I am just a beginner in all this so I don't understand all of the implications with settings and data but I am using the INTERNAL oscillator as mentioned on page 37 section 4.5 'Internal Oscillator Block'. If you then go to page 40 and see the bit setting parameters for OSCCON including '110' for 4MHZ the binary - as I saw it at the time - became 01100000 which is Hex 60. So The Tx and Rx flowcharts start with a C block that is "osccon=0x60;" to set up the oscillator. That seems to work fine with the F88. However now I look at it again I'm not sure about bits 3 to 0 and whether that is significant for the (L)F88. What do you reckon?
Chris
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
According to the datasheet:
This is what I would do if it was me (assuming you have access to a scope):
evey 10 or so milliseconds keep sending a single upper-case U in
nothing else.
So you would have
Loop while 1
SendRS232String "U"
Delay 10ms
Repeat for ever.
Now measure with a scope the duration of the 1st off bit.
If duration is 104uS then baud rate = 1/104EE-06 = 9600
If you can measure duration then use custom setting and enter new baud rate into the receiver.
Try with the normal 18F88 first so you can see waht the correct waveform looks like.
I know data sheets are very confusing since on page 174 there is this:
Code: Select all
11.1.2 LOW-POWER MODE OPERATION
The system clock is used to generate the desired baud
rate; however, when a low-power mode is entered, the
low-power clock source may be operating at a different
frequency than in full power execution. In Sleep mode,
no clocks are present. This may require the value in
SPBRG to be adjusted.
evey 10 or so milliseconds keep sending a single upper-case U in
nothing else.
So you would have
Loop while 1
SendRS232String "U"
Delay 10ms
Repeat for ever.
Now measure with a scope the duration of the 1st off bit.
If duration is 104uS then baud rate = 1/104EE-06 = 9600
If you can measure duration then use custom setting and enter new baud rate into the receiver.
Try with the normal 18F88 first so you can see waht the correct waveform looks like.
I know data sheets are very confusing since on page 174 there is this:
Martin
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Chris,
According to the data sheet your osccon settings should be right. The chip settings are where the settings I mentioned earlier are configured. From the data sheet (and the additional information in Oscillator - PICmicro Mid-Range MCU Family) my best guess is you need to select "EXTRC as Port I/O" for the Oscillator selection in the expert settings. (Chip->configure, switch to export config screen).
Best regards,
Jac
According to the data sheet your osccon settings should be right. The chip settings are where the settings I mentioned earlier are configured. From the data sheet (and the additional information in Oscillator - PICmicro Mid-Range MCU Family) my best guess is you need to select "EXTRC as Port I/O" for the Oscillator selection in the expert settings. (Chip->configure, switch to export config screen).
Best regards,
Jac
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Thanks Martin, I been looking at the data sheets today in fact, to try and understand them a bit better but I will see if my scope is capable and give your suggestion a go if it is.
Many thanks,
Best regards,
Chris
Many thanks,
Best regards,
Chris
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Chris,
Something completely different. Have you enabled brown out detect in the (expert) settings? If so you'll need to disable it as it will keep the chip in reset mode until the voltage exceeds 3.65V.
Regards,
Jac
Something completely different. Have you enabled brown out detect in the (expert) settings? If so you'll need to disable it as it will keep the chip in reset mode until the voltage exceeds 3.65V.
Regards,
Jac
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Sorry Jac, I just seen your message re:
"According to the data sheet your osccon settings should be right. The chip settings are where the settings I mentioned earlier are configured. From the data sheet (and the additional information in Oscillator - PICmicro Mid-Range MCU Family) my best guess is you need to select "EXTRC as Port I/O" for the Oscillator selection in the expert settings. (Chip->configure, switch to export config screen)."
But isn't that for external timing componentsthough?
"According to the data sheet your osccon settings should be right. The chip settings are where the settings I mentioned earlier are configured. From the data sheet (and the additional information in Oscillator - PICmicro Mid-Range MCU Family) my best guess is you need to select "EXTRC as Port I/O" for the Oscillator selection in the expert settings. (Chip->configure, switch to export config screen)."
But isn't that for external timing componentsthough?
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Hi Martin,
Before re-programming the F88 I scoped the UART signal (which I hadn't done with THEM as they worked OK!) and now I have a readable trace and the duration of the first off bit appears to be exactly 104uS. Unfortunately with the FL88, the Tx output is far too small to measure the same thing. Which could be a pointer?
Before re-programming the F88 I scoped the UART signal (which I hadn't done with THEM as they worked OK!) and now I have a readable trace and the duration of the first off bit appears to be exactly 104uS. Unfortunately with the FL88, the Tx output is far too small to measure the same thing. Which could be a pointer?
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
You are right. Given the conditions in the data sheet I was under the impression INTOSC would not work. However, some googling resulted in a couple of messages stating it should work.christoph wrote:But isn't that for external timing componentsthough?
I just checked Flowcode 5, the 16LF88 is not listed among the devices. So I guess nothing special has been done to support it. (Every message I come across suggests all 16F88 code should work)
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
so that's within a good tolerance ((1/104E-06 - 9600)/9600)*100 = 0.16%christoph wrote:now I have a readable trace and the duration of the first off bit appears to be exactly 104uS.
Small, as in amplitude, or small as in narrow pulse? If so then baud is higher than 9600.christoph wrote:Unfortunately with the FL88, the Tx output is far too small to measure the same thing. Which could be a pointer?
If narrow, then reduce delay to say 500us or less. You may even have a scope with single shot on negative trigger or pulse measurement facility
So if you can get a pulse duration that would help.
If you can send a picture of trace e.g taken with phone, camera and post on forum as .png that would be handy.
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Hi Jac,
That's strange because Matrix M. said it had been included in v5. You are right in that opinion says they should work with the F88 programming and I noticed that Sparkfun use the LF version for their UART serial operated LCD at 3volts but of course that may have been programmed in C directly or in some other language. I'm sure there is a simple answer and I have e-mailed Matrix to shed some light on it. As Martin is indicating in these posts it could be a timing issue - or purely a Flowcode tweak - I don't know...
That's strange because Matrix M. said it had been included in v5. You are right in that opinion says they should work with the F88 programming and I noticed that Sparkfun use the LF version for their UART serial operated LCD at 3volts but of course that may have been programmed in C directly or in some other language. I'm sure there is a simple answer and I have e-mailed Matrix to shed some light on it. As Martin is indicating in these posts it could be a timing issue - or purely a Flowcode tweak - I don't know...
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Hi Martin,
Smaller as in amplitude but only cos running at 3volts but tiny in pulse width. I may not have made it clear but that pulse width is not with the little 'while' routine you posted that is with the .fcf's that you last sent. I didn't take it further cos I cant lock on to the 'blip' that I get with the LF88 or make it large enough to see an individual pulse and no decent features on the scope either. If your routine will actually expand the pulse width I will do that but I think what you are aiming for is to find what the pulse width actually is then increase it accordingly?
Chris
Smaller as in amplitude but only cos running at 3volts but tiny in pulse width. I may not have made it clear but that pulse width is not with the little 'while' routine you posted that is with the .fcf's that you last sent. I didn't take it further cos I cant lock on to the 'blip' that I get with the LF88 or make it large enough to see an individual pulse and no decent features on the scope either. If your routine will actually expand the pulse width I will do that but I think what you are aiming for is to find what the pulse width actually is then increase it accordingly?
Chris
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F88 vs PIC16(L)F88
Yep that sounds like a plan.christoph wrote: If your routine will actually expand the pulse width I will do that but I think what you are aiming for is to find what the pulse width actually is then increase it accordingly?
What you could do, is change baud rate from 9600 to 1200 or 2400, and recheck to see with the new pulse duration is?
you may find you reach the required 9600.
Can you also change osc mode to internalRC with clockout then measure the clockout frequency and make sure its correct at 1MHz.
You may need to adjust osc frequency with osctune register?
Martin