16F18877 and ENC28J60

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

16F18877 and ENC28J60

Post by EtsDriver »

ENC is losing software defined pins after every load? Every time i load the file, the pins have changed to something else i had set up when saving?

Ive got following when saving:

C1=CS ENC
C3=SCK
C4=MISO
C5=MOSI
A3= ENC reset

After closing flowcode and opening it again:

CS ENC = C1
MISO = unconnected
MOSI =C2
RESET ENC= A3

Took the file download out as newer posted below.
Ill just keep the good work up!

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: 16F18877 and ENC28J60

Post by Benj »

Thanks for letting us know, hopefully the attached component will solve the problem for you.

This will also resolve the init waiting forever on a broken module problem you reported.

Simply copy the file into your "Flowcode 7/components" directory and restart Flowcode for the changes to be made.
TCPIP_ENC28J60.fcpx
(19.44 KiB) Downloaded 283 times
Let me know how you get on.

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: 16F18877 and ENC28J60

Post by EtsDriver »

After applying update and trying to compile i now get error:

Code: Select all

C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_SPI.c: FC_CAL_SPI_Master_Init_1()
   173:	tris |= (1 << (0));
	^ (192) undefined identifier "tris"
   190:	SSPSTATbits.CKE = (((2) & 0x02))?1:0;
	^ (192) undefined identifier "SSPSTATbits"
	                ^ (196) struct/union required
   191:	SSPSTATbits.SMP = (((2) & 0x04))?1:0;
	                ^ (196) struct/union required
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_SPI.c: FC_CAL_SPI_Master_Uninit_1()
   217:	tris |= (1 << (0));
	^ (192) undefined identifier "tris"
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_SPI.c: FC_CAL_SPI_Master_Byte_1()
   301:	SSPBUF = DataOut;
	^ (192) undefined identifier "SSPBUF"
   302:	while ((SSPSTAT & 0x01) == 0);
	        ^ (192) undefined identifier "SSPSTAT"
(908) exit status = 1
(908) exit status = 1

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



FINISHED
Ill just keep the good work up!

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: 16F18877 and ENC28J60

Post by Benj »

Ok thanks maybe the channel has not refreshed correctly. Maybe switch to a hw channel and back again to workaround and I'll investigate.

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: 16F18877 and ENC28J60

Post by EtsDriver »

Hi!

I think there is now a new bug there?

When trying to use HW channels, the code will not compile...

Code: Select all

C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe  --chip=16F18877 "SW_LEDTEST.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

SW_LEDTEST.c:
  7410:		#warning "This interrupt has previously been enabled, so the macro <tmr> may never get called."
	                                                                                                      ^ (162) #warning: "This interrupt has previously been enabled, so the macro <tmr> may never get called." (warning)
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_SPI.c: FC_CAL_SPI_Master_Init_2()
   190:	SSPSTATbits.CKE = (((2) & 0x02))?1:0;
	^ (192) undefined identifier "SSPSTATbits"
	                ^ (196) struct/union required
   191:	SSPSTATbits.SMP = (((2) & 0x04))?1:0;
	                ^ (196) struct/union required
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_SPI.c: FC_CAL_SPI_Master_Byte_2()
   301:	SSPBUF = DataOut;
	^ (192) undefined identifier "SSPBUF"
   302:	while ((SSPSTAT & 0x01) == 0);
	        ^ (192) undefined identifier "SSPSTAT"
(908) exit status = 1
(908) exit status = 1

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



FINISHED

Attachments
SW_LEDTEST.fcfx
added ethernet functionality from MCP28J60 example
(58.24 KiB) Downloaded 249 times
Ill just keep the good work up!

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: 16F18877 and ENC28J60

Post by Benj »

Thanks for letting us know,

The attached updated CAL file should solve the compilation error and let you use SPI hardware channel 1 on the device.

The file needs to be placed into the "Flowcode 7/CAL/PIC" folder.
PIC_CAL_SPI.c
(12.68 KiB) Downloaded 259 times
Let me know how you get on.

Post Reply