Pic 16LF1906

Moderator: Benj

Post Reply
User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Pic 16LF1906

Post by psf »

Hi everybody. As usually I'm going to "complicate" my life with a new Pic I discovered: 16LF1906. Flowcode actually support 16LF1903 that is quite similar (1906 have double program memory and EUSART which I don't use). So I try to update the .fcd file (flowcode discovered the new component) but probably there should be problems with C compiler because if I compile an empty programs I get some errors:

Lcd2.c(68:2): error: unknown identifier 'ansela'
Lcd2.c(68:2): error: invalid operand 'ansela'
Lcd2.c(68:9): error: failed to generate expression
Lcd2.c(69:1): error: unknown identifier 'anselb'
Lcd2.c(69:1): error: invalid operand 'anselb'
Lcd2.c(69:8): error: failed to generate expression
Lcd2.c(73:2): error: unknown identifier 'option_reg'
Lcd2.c(73:2): error: invalid operand 'option_reg'
Lcd2.c(73:13): error: failed to generate expression

By the way if I compile empty program on 1903 everything OK.

Thanks in advance!

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: Pic 16LF1906

Post by Benj »

Hello,

It looks like the 1906 device is not currently supported by the BoostC compiler packaged with Flowcode. Is it possible for you to use another device? Otherwise you may have better results using the HiTech compiler with this new device.

http://www.matrixmultimedia.com/mmforum ... =26&t=6812

User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: Pic 16LF1906

Post by psf »

I use 1906 just for program memory, and I already bought it. I can use the other C compiler if it's ok. But another way: can we just manage 1903 in order to create a program for 1906. I don't need the EUSART, just LCD driver and the double program memory.

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Pic 16LF1906

Post by Steve »

I think if you use Flowcode to create a program for the 16LF1903, it has a good chance of working in the 16LF1906.

User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: Pic 16LF1906

Post by psf »

So, installed HI tech c, but there is a problem with C icon:
e.g.
asm clrf _lcddata0
asm clrf _lcddata1
....
compiling with BOOSTC everything is ok but HItech tell me:

106: asm clrf _lcddata0
^ (317) "(" expected
^ (318) string expected
^ (194) ")" expected
^ (312) ";" expected
.....
and so on, many many errors...

I try Steve method also. The 16LF1903 lib is defected: LCDSE3 register is missing (only in1903, 1906 that is quite the same is OK). By the way even HI TECH library has the same mistake, but fortunately can be resolved writing few words.

Thanks for help.

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: Pic 16LF1906

Post by Benj »

Hello,

I think for HiTech you have to do assembler code like this.

ASM("NOP");

User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: Pic 16LF1906

Post by psf »

Benj wrote:Hello,

I think for HiTech you have to do assembler code like this.

ASM("NOP");
Great!
BUT
Now HITECH discovered other 2 errors:

Lcd3.c: main()
1720: INT0IE = 1;
^ (192) undefined identifier "INT0IE"
Lcd3.c: myisr()
1848: if (ts_bit(INTCON, INT0IF) && ts_bit(INTCON, INT0IE))
^ (192) undefined identifier "INT0IF"
(192) undefined identifier "INT0IE" ^

The strange is that in c code generated by flowcode these parts are:

st_bit(intcon, INTE);
if (ts_bit(intcon, INTF) && ts_bit(intcon, INTE))

I can't understand if it's a problem of Flowcode or >>>>(HITECH)<<<<<; I have even modified the .h file in order to rename the 2 flags but it's a nonsense!

User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: Pic 16LF1906

Post by psf »

Hi guys, after hours I found out a solution, SOURCEBOOST released V7.05.1 that support 16LF1906, I installed the lite version just to make some experiment and it work perfectly without any mistake.
I hope it could be integrated in Flowcode because I read minor upgrades are free.

Just a more suggestion (only for reference /google index) Microchip data-sheet for 16LF1906 has many errors on LCD segment mapping worksheet page 201.
Last 3 (5 for 1607) segment 24/25/26 are not in LCDDATA2 (COM0) and LCDDATA5 (COM1) and so on BUT consider LCDDATA12 /LDCDATA15 ....
Also the BITS are wrong they aren't for example SEG26COM0 LCDDATA2,7 >>>>BUT>>>>>> LCDDATA12,2 and so on.
In the other section of data-sheet they are reported correctly but working on it the first time it's not so easy to debug this small problem.

Have a nice weekend!

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: Pic 16LF1906

Post by dazz »

thanks for the heads up ,it will save a lot of head scratching if someone else uses that chip
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

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: Pic 16LF1906

Post by Benj »

Thanks for the update,

I will see if we can get an update for BoostC into the next update release so this is no longer an issue.

Post Reply