16LF1827 & 16F1827

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
rondesgr
Posts: 18
Joined: Sun Sep 26, 2010 2:03 pm
Has thanked: 3 times
Contact:

16LF1827 & 16F1827

Post by rondesgr »

In using Flowcode 4.5 with a PIC16F1827 and PIC16LF1827, I discovered the following:

1) The configuration window for the 16 F 1827 doesn't now let you select the Intosc freq if you have configure the chip for an internal oscillator. It seems to default the chip to the 125 kHz clock.

2) While the chip selection list shows the 16LF1827 version, I get an "unrecognized chip <PIC16LF1827>" error. Clicking [OK] generates another error:
"Unable to create microcontroller 16LF1827 as the definition file 16LF1827.FCD is missing or corrupt."
When I look in the /FCD directory, the 16F1827.FCD is listed but not the 16LF version. Is there any way to get the LF version of the file?

Thanks,
Ron

Rosenbaum
Flowcode V4 User
Posts: 25
Joined: Thu Feb 22, 2007 3:20 pm
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: 16LF1827 & 16F1827

Post by Rosenbaum »

@2: I cant' help.

@1: You have to set the clockspeed in a "C-Code"-block manually. In the Datesheet on Page 67 you will see the correct dataword(s).

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: 16LF1827 & 16F1827

Post by Benj »

Hello,

Here is an updated set of files.

Firstly here is a FCD for the 18LF1827 device. simply drop this file into your "Flowcode v4/FCD" directory and the device will then be a viable target in Flowcode.
16LF1827.fcd
(10.15 KiB) Downloaded 308 times
Next the PPP software needs to be updated to allow the device to be configured correctly. Extract the attached zip file into your "Flowcode v4/tools/ppp" directory overwriting any files when prompted.
PPP.zip
(1.28 MiB) Downloaded 319 times

rondesgr
Posts: 18
Joined: Sun Sep 26, 2010 2:03 pm
Has thanked: 3 times
Contact:

Re: 16LF1827 & 16F1827

Post by rondesgr »

Thank you, Benj. Files installed and code ran without error.

rondesgr
Posts: 18
Joined: Sun Sep 26, 2010 2:03 pm
Has thanked: 3 times
Contact:

Re: 16LF1827 & 16F1827

Post by rondesgr »

Rosenbaum wrote: @1: You have to set the clockspeed in a "C-Code"-block manually. In the Datesheet on Page 67 you will see the correct dataword(s).
Hi Rosenbaum,

Would you know Flowcode4's corresponding variable or constant that I would update with the PIC data word?

Thanks,
Ron

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: 16LF1827 & 16F1827

Post by Benj »

Hello Ron,

Adding this line of C code to the start of your program will give you a 16MHz internal oscillator according to the datasheet.

osccon = osccon | 0x78;


This line of C code should give you 32MHz internal oscillator - 8MHz x PLL multiplier 4.

osccon = osccon | 0xF0;


Let me know how you get on.

rondesgr
Posts: 18
Joined: Sun Sep 26, 2010 2:03 pm
Has thanked: 3 times
Contact:

Re: 16LF1827 & 16F1827

Post by rondesgr »

Hello Benj,

The only minor bug that I've come across is that enabling the "Auto Clear Watchdog" timer doesn't seem to work. Since the watchdog isn't critical at this point in the project, I'm going to disable it in the configuration file.

Thanks,
Ron

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

Dear Ben,

I also use the 16F1827 and installed the updates as given above. PPP both in Matrixmultimedia/common/PPPv3 directory and in FlowcodeV4/Tools/PPP directory. But now PPP gives the error:

"Registry error: Failed to get data for CONFIG8L"

Can you help?

Kind regards

Jan Lichtenbelt

PS. Error is independend of microcontroller used

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: 16LF1827 & 16F1827

Post by Benj »

Hello Jan,

The latest PPP files I posted are meant only to replace the files in the Flowcode v4/Tools/PPP directory. Have you tried deleting the contents of the PPP folder and using only the files from the zip file?

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

Hello Ben,

I tried both:
1) deleting the 'old' files and placing the new files in the directory Flowcode4/tools/ppp
2) replacing the new files with 'copy and replace' old files

But both gave the same error message.

Jan

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: 16LF1827 & 16F1827

Post by Benj »

Hi Jan,

That's odd I am unable to replicate your problem here. Here is a new set of files straight from my Flowcode v4 directory so lets see how you get on with them.
Attachments
PPPupdate.zip
(1.28 MiB) Downloaded 276 times

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

Dear Ben,

I installed the new PPP files. First I got the same error message. Then I changed the config settings, all options disabled, expect the MCLR. Then the error message has disappeared. But a new one appeared : PICmicro has not been erased, and a programming failure (see txt file).

Kind regards

Jan
Attachments
Test_1827.msg.txt
(4.03 KiB) Downloaded 212 times
Test_1827.fcf
(4.5 KiB) Downloaded 193 times

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

I do not know why, but I got the micrcontroller working now with internal oscillator osccon= 0x7B; That is a step in a good way.
However, the microcontroller is not yet working with the external HS oscillator. There has to be done some research.


Kind regards,

Jan Lichtenbelt

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: 16LF1827 & 16F1827

Post by Benj »

Hi Jan,

Right I have been through the current PPP config settings for the 16F1827 device and the values are correct for what the datasheet is saying. I have some of the devices here so I will try and have a play for you this afternoon and let you know how I get on.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

Hi Ben,

I forgot the say that I used the original Flowcode V4.5 files in my last try.
I mend with 'research' more myself, but of coarse I appreciate your help.

Kind regards

Jan

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

Here the results:

Oscillator / osccon / result
external HS / 0x00 / does not work (see also below)
Internal 16 MHz / 0x7B / works correctly
Internal 8 MHz / 0x72 / works correctly
Internal 32 MHz / 0xF0 / does not work (with PLL enabled in config word 1)
Added 23-10-2011:
external HS and ECH Clock High with the EB006 board / the microcontroller starts up very slowly. I guess 50 time to slow.
Now the 32 MHz internal clock does work also. That must be, because it is Sunday???

This all seems not very stable. Is it possible to measure the frequency used by the micrcontroller?

Kind regards

Jan Lichtenbelt

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

To test the 32 MHz oscillator I set PLL enabled (config word) and osccon= 0xF2;
To test the oscillator on the CLKR output pin RA6 the clkrcon= 0xD0; and CLKOUTEN bit should be 1 (config word).
The scope picture shows me an 8 MHz signal, which is indeed the oscillator frequency.

Still the question: Can the presence of 32 MHz signal be tested in 16F1827?

Jan Lichtenbelt

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

Research helps!

Osccon=0xF2; is indeed 8 MHz and osccon 0xF0; is 32 MHz. These frequencies has been measured with a scope on pin RA6 (note 1). However, the LCD (EB005 board) does not work correctly anymore with this high frequency of 32 Mhz. Propably due to a synchronisation error?
Sure, the delay functions are based on the 19 / 20 Mhz oscillators. Increasing the frequency will decrease the delay time with the same factor (note 2). And that can make that the LCD does not work correctly anymore.


Jan Lichtenbelt

Note 1: Pay attention, the internal oscillator on pin RA6 can not be performed with board EB006. I used the board as described in the article MX007
http://www.matrixmultimedia.com/mmforum ... =36&t=8279
Note 2, the assembler macro's for the delay functions stay the same. These delay functions are based on the number of programming steps. And the time of the programming steps depends on the frequency used)
Last edited by Jan Lichtenbelt on Thu Oct 27, 2011 11:18 am, edited 1 time in total.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: 16LF1827 & 16F1827

Post by Jan Lichtenbelt »

The microcontroller 16F1827 works correctly on 32 MHz!!!!

Working with 16F1827 with an internal frequency of 32 MHz, will decrease the delay times with a factor 20/32, resulting in e.g. failing LCD synchronisation. To check the correct working of the 16F1827 I used a second board with the traditional frequency of 19... MHz connected to the LCD board

The data from 1827 are placed on portB and read by 877A on portC. The LCD shows now correct the data produced by the 1827, working on 32 MHz with osccon=0xF0 (or 0x70 and PLL of the config word enabled).


Kind regards

Jan Lichtenbelt

Post Reply