assasinsareus 0 Report post Posted December 22, 2014 Hello, When I compile the following I get errors relating to unknown registers on the 18F45K50 device. trise = 0x00; LKPSU_Firmware.c(2716:25): error: unknown identifier 'trise'LKPSU_Firmware.c(2716:25): error: invalid operand 'trise' commands to portd also generate errors but not as straightforward. the FC_CAL function is my abstraction function which works well on other devices. LKPSU_Firmware.c(6126:12): error: invalid operand 'FC_CAL_Port_In_DDR__x((&FCP_PORT_D), (&FCP_TRIS_D), ( 0x1), ( 0x0))'LKPSU_Firmware.c(6126:8): error: failed to generate expressionLKPSU_Firmware.c(6163:43): error: invalid identifier Is there any way I can fix this? I have promised firmware to the Chinese for December the 25th and have it all done and ready to go except it won't currently compile on this device! Quote Share this post Link to post Share on other sites
assasinsareus 0 Report post Posted December 22, 2014 Found there is a bug in the include for the 18F45K50 in the file BoostCPic18.h #ifdef _PIC18F45K50 #include <PIC18F24K50.h>#endif // _PIC18F45K50 Quote Share this post Link to post Share on other sites
assasinsareus 0 Report post Posted December 22, 2014 Also further bugs in the 45K50 header file relating to TRIS and LAT for ports d and e. Seem to be getting somewhere now Quote Share this post Link to post Share on other sites
assasinsareus 0 Report post Posted December 22, 2014 Managed to make it work correctly by changing this in the BoostCPic18.h file. Might be other things lurking! #ifdef _PIC18F45K50- #include <PIC18F24K50.h>+ #include <PIC18F45K50.h> #endif // _PIC18F45K50 And this change in the PIC18F45K50.h file. volatile char ccp2con @CCP2CON;+volatile char trise @TRISE;+volatile char trisd @TRISD; volatile char trisc @TRISC; volatile char ctmuconl @CTMUCONL;+volatile char late @LATE;+volatile char latd @LATD; volatile char latc @LATC; volatile char porte @PORTE;+volatile char portd @PORTD; volatile char portc @PORTC; - indicates a line removed and + indicates a line added Quote Share this post Link to post Share on other sites
johnsomu 0 Report post Posted December 22, 2014 Good to know! One would assume that the device headers are correct but not necessarily so. Thanks for sharing the information. Murray Quote Share this post Link to post Share on other sites