Migration from PIC16F18345 to PIC16F18444

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
User avatar
CamargoF
Posts: 36
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 7 times
Contact:

Migration from PIC16F18345 to PIC16F18444

Post by CamargoF »

I need to migrate a firmware from PIC16F18345 to PIC16F18444, due to the lack of devices on the market.

I set the new device and I did not make any change in the block code.
The compilation fails, as described below. I believe there is some error in the implementation of the PIC16F18444 code.
I am running Flowcode v8.2.2.15 and the database is up-to-dated.
I appreciate any help.

The first time I tried to compile, only replacing the PIC module (properly reconfigured) I had this error:

Code: Select all

FC202230105_3v7A.c: __EEPROM_DATA()
   430:	__EEPROM_DATA('B','l','o','c','k','l','i','n');
	              ^ (194) ")" expected
   431:	__EEPROM_DATA('e',' ','K','O','1','1',' ','3');
	              ^ (194) ")" expected
   432:	__EEPROM_DATA('v','7',' ','b','y',' ','C','o');
	              ^ (194) ")" expected
   433:	__EEPROM_DATA('n','s','e','n','g',0x0A,0x0D,0x00);
	              ^ (194) ")" expected
   434:	__EEPROM_DATA(0x01,0x03,0x01,0x01,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   435:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   436:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   437:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA);
	              ^ (194) ")" expected
   438:	__EEPROM_DATA(0x01,0x03,0x01,0x01,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   439:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   440:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   441:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xDD);
	              ^ (194) ")" expected
   442:	__EEPROM_DATA(0x01,0x03,0x01,0x01,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   443:	__EEPROM_DATA(0x00,0x00,0x01,0x04,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   444:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   445:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0xFF);
	              ^ (194) ")" expected
   446:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   447:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   448:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
   449:	__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
	              ^ (194) ")" expected
FC202230105_3v7A.c: 450: too many errors (21)
(908) exit status = 1
(908) exit status = 1

Error returned from xc8.exe
For some reason the compiling rejects the EEPROM initial values.
I don't know the reason since both PICs have the same EEPROM size.

So, I clear the EEPROM initial values and tried to compile a second time.
Then the compilation fails again, but with another set of errors:

Code: Select all

C202230105_3v7A.c: main()
  8927:	PIE1bits.TMR2IE = 1;
	                ^ (255) not a member of the struct/union ""
	                   ^ (182) illegal conversion between types
int -> volatile union S846
  8931:	PIE1bits.RC1IE = 1;
	               ^ (255) not a member of the struct/union ""
	                  ^ (182) illegal conversion between types
int -> volatile union S846
FC202230105_3v7A.c: myisr()
  8990:	if ((PIR1bits.TMR2IF) && (PIE1bits.TMR2IE))
	                    ^ (255) not a member of the struct/union ""
	                                         ^ (255) not a member of the struct/union ""
	              (199) logical type required ^
	              (199) logical type required ^
  8993:	PIR1bits.TMR2IF = 0;
	                ^ (255) not a member of the struct/union ""
	                   ^ (182) illegal conversion between types
int -> volatile union S828
  9003:	if ((PIR1bits.RC1IF) && (PIE1bits.RC1IE))
	                   ^ (255) not a member of the struct/union ""
	                                       ^ (255) not a member of the struct/union ""
	            (199) logical type required ^
	            (199) logical type required ^
  9006:	PIR1bits.RC1IF = 0;
	               ^ (255) not a member of the struct/union ""
	                  ^ (182) illegal conversion between types
int -> volatile union S828
(908) exit status = 1
(908) exit status = 1

Error returned from xc8.exe
I don't understand why the interrupt blocks for TIMER2 and UART are failing.

These pictures shows the block interrupt setup:
InterruptBlock=UART-TX.jpg
InterruptBlock=UART-TX.jpg (26.98 KiB) Viewed 21632 times
InterruptBlock=TIMER2.jpg
InterruptBlock=TIMER2.jpg (28.92 KiB) Viewed 21632 times

This picture shows the configuration I am using for PIC16F18444:
PIC16F18444=Configure.jpg
PIC16F18444=Configure.jpg (120.54 KiB) Viewed 21632 times
I appreciate any help.

Best regards,

Fernando

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: Migration from PIC16F18345 to PIC16F18444

Post by Benj »

Hello Fernando,

Investigating now for you, hopefully should be a quick one to resolve.

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times

Re: Migration from PIC16F18345 to PIC16F18444

Post by Bachman »

The first time I tried to compile, only replacing the PIC module (properly reconfigured) I had this error:
I've seen this type of inexplicable errors in earlier versions of Flowcode after same step. I'm not sure what is causing this, maybe some cache problems. Until Benj solve this, try the following:

Start a new project with PIC16F18444, configure the PIC. Open the older, working project, and export every macros one-by-one. In the new project, import every macros. If asked, always use the existing variables, othervise will be duplicated and renamed in the imported macros. If I remember well, the "main" macro can't be exported, so select every icon, copy and paste it onto the new. Check that, you have same variables in the new and old project. Cross fingers and try to compile.

At this point, I don't have better solution, maybe more than nothing.

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times

Re: Migration from PIC16F18345 to PIC16F18444

Post by Bachman »

Interrupt errors:

The two PICs have different interrupt table. Delete the interrupt an recreate. PIC changed, contents of interrupt enable, disable and handle code not. Maybe same error with EEPROM.
ScreenShot_594.jpg
ScreenShot_594.jpg (137.94 KiB) Viewed 21583 times

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: Migration from PIC16F18345 to PIC16F18444

Post by Benj »

Hopefully solved for you now via the Help -> Check for updates.

Post Reply