PIC16F88 - PWM not working

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

Post Reply
johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

PIC16F88 - PWM not working

Post by johnsondav »

Hi Everyone

I am having trouble with the PWM component for the PIC16F88, it will not compile. The compiler is reporting the following errors:
Title:
Description:
Device: PIC.16F.16F88
Generated by: Flowcode v7.2.1.4
Date: Monday, September 04, 2017 20:07:02
Users: 1
Registered to: johnsondav
Licence key: XXXXXX
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe --chip=16F88 "Flowcode1.c" --MSGDISABLE=359,1273,1388
Microchip MPLAB XC8 C Compiler (Free Mode) V1.41
Build date: Jan 24 2017
Part Support Version: 1.41
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

Flowcode1.c: 247: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
0: (1347) can't find 0x8E words (0x8e withtotal) for psect "text10" in class "CODE" (largest unused contiguous range 0x66)
0: (1347) can't find 0x8E words (0x8e withtotal) for psect "text12" in class "CODE" (largest unused contiguous range 0x66)
0: (1347) can't find 0x8D words (0x8d withtotal) for psect "text24" in class "CODE" (largest unused contiguous range 0x66)
0: (1347) can't find 0x6E words (0x6e withtotal) for psect "text18" in class "CODE" (largest unused contiguous range 0x66)
0: (1347) can't find 0x68 words (0x68 withtotal) for psect "text8" in class "CODE" (largest unused contiguous range 0x66)
0: (1347) can't find 0x5F words (0x5f withtotal) for psect "text13" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x51 words (0x51 withtotal) for psect "strings" in class "STRING" (largest unused contiguous range 0x13)
0: (1347) can't find 0x41 words (0x41 withtotal) for psect "text15" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x41 words (0x41 withtotal) for psect "text20" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x3C words (0x3c withtotal) for psect "text11" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x31 words (0x31 withtotal) for psect "text27" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x2C words (0x2c withtotal) for psect "text3" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x29 words (0x29 withtotal) for psect "text1" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x27 words (0x27 withtotal) for psect "text28" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x1E words (0x1e withtotal) for psect "text30" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x1B words (0x1b withtotal) for psect "maintext" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0x17 words (0x17 withtotal) for psect "text5" in class "CODE" (largest unused contiguous range 0x13)
0: (1347) can't find 0xF words (0xf withtotal) for psect "text2" in class "CODE" (largest unused contiguous range 0x6)
0: (1347) can't find 0xE words (0xe withtotal) for psect "text26" in class "CODE" (largest unused contiguous range 0x6)
0: (1347) can't find 0xB words (0xb withtotal) for psect "text31" in class "CODE" (largest unused contiguous range 0x6)
0: (1347) can't find 0x8 words (0x8 withtotal) for psect "clrtext" in class "CODE" (largest unused contiguous range 0x6)
0: (1347) can't find 0x8 words (0x8 withtotal) for psect "text16" in class "CODE" (largest unused contiguous range 0x6)
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1

I am not doing anything at all with the program, just initialising. Here is the very basic project which produces this error:
Flowcode1.fcfx
(8.33 KiB) Downloaded 196 times
I have come across error this by chance. I was reviewing a previous working project which does not now work, which is strange, as it was working previously. Any suggestions would be most welcome.

Regards
Dave

medelec35
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 - PWM not working

Post by medelec35 »

Hi Dave,
Can you see if this post helps.

Martin
Martin

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PIC16F88 - PWM not working

Post by johnsondav »

Hi Martin

You are a star. Thank you ever so much. It is working as before.

Your help is very much appreciated.

Kind Regards
Dave

medelec35
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 - PWM not working

Post by medelec35 »

Your welcome Dave,
Glad I can help.

Martin
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: PIC16F88 - PWM not working

Post by jgu1 »

Hi Martin!

Yesterday I tested Dave´s program and with different deviceses and get the same result. After update of the file, it seemed to be ok, But what does the first and the last line mean???


What is this: PPPWWWmm.c: 239: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)

Thank´s in advance..


Memory Summary:
Program space used 380h ( 896) of 1000h words ( 21.9%)
Data space used 2Eh ( 46) of 170h bytes ( 12.5%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of 60h bytes ( 0.0%)
Configuration bits used 2h ( 2) of 2h words (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)


You have compiled in FREE mode.
Using Omniscient Code Generation that is available in PRO mode,
you could have produced up to 60% smaller and 400% faster code.
See http://www.microchip.com/MPLABXCcompilers for more information.


Launching the linker/assembler...
C:\Program Files\Flowcode 7\tools\DoNothing\DoNothing.exe


FINISHED

Br Jorgen

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PIC16F88 - PWM not working

Post by johnsondav »

Hi Everyone.

I am still having problems with the PWM for the PIC16F88. It is working in simulation but I am not getting anything from the actual chip. I have tried another chip replacement in a previously working project circuit, but still no output from pin B0 (tested using scope). Here is the project:
HF Controller 1 V7.0_v7.fcfx
(33.75 KiB) Downloaded 184 times
Its a test module for a High voltage HF controller.

Tested the chip using an older HEX file dated Feb 2016, which works fine:
HF Controller 1 V6.0.hex
(14.13 KiB) Downloaded 183 times

Your suggestions/help would be very much appreciated.

Dave

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC16F88 - PWM not working

Post by LeighM »

Could you just check your timer setting...
timer.jpg
timer.jpg (38.86 KiB) Viewed 5314 times

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PIC16F88 - PWM not working

Post by johnsondav »

Hi Leigh

Thank you ever so much. I feel a fool to have missed that. Just goes to show, you see what you want to see and not what is really there.

Many Thanks for you help.

Best Regards
Dave

Post Reply