Author Topic: Does Real time clock in netcruzer library V203 work?  (Read 6767 times)

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Does Real time clock in netcruzer library V203 work?
« on: March 30, 2014, 11:42:50 PM »
Hi

I looked through nz_rtc.h and nz_rtc.c, but it seemed the code has not finished.  The example in the nz_rtc.h was about LCDDisplay not the real time clock and nothing on the nz_rtc.c.  Am I missing something?

Regards,
Bua

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #1 on: April 01, 2014, 03:31:07 AM »
Hello Bua

No, it is not finished yet. But, I will aim to have it done by next week. Also have another customer who urgently needs it.

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #2 on: April 01, 2014, 04:43:51 PM »
Great!  Looking forward to having it.

Cheers,
Bua

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #3 on: April 09, 2014, 07:16:51 AM »
Hey modtro2,

I just wonder, if you have finished the library for real-time clock yet.

Cheers,
Bua

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #4 on: April 27, 2014, 05:44:20 PM »
The RTC code is done, and will be included with next release of the "Netcruzer Download". Will also contain an RTC demo project. You can try the following. I hope I have included all steps required for adding to an old project. Please let me know if it compiles.

1) Replace your "../src/netcruzer/lib" files with files contained in the attached lib_20140428-1010.zip (make backup of existing file first!). I don't think you should have made any changes to these files.


2) Add new RTC files "nz_rtc.c" and "nz_rtc.h" to your MPLAB X project.


3) Add following line to the file you want to use the new RTC functions in:
#include "nz_rtc.h"


4) Add following lines to your projdefs.h file:
// *********************************************************************
// ------------ RTC Configuration (from nz_rtc.h) -------------
// *********************************************************************
#define NZ_RTC_ENABLED                          (1) //Enable RTC
#define NZ_RTC_UNLOCK                           (1) //Unlock RTC during initialization


5) You should now be able to use the new RTC code. See included demo project for examples how to use it.


6) FOR EXAMPLE (taken from demo project), to set time:
            RTC_TIME tm;
            tm.hour = 11;
            tm.min = 40;
            tm.sec = 50;
            rtcSetTime(&tm);


7) FOR EXAMPLE (taken from demo project), to get time:
            RTC_TIME tm;
            rtcGetTime(&tm, 0); //Get time in standard binary format
            printf("\nTime: %02d:%02d:%02d", tm.hour, tm.min, tm.sec);


8) FOR EXAMPLE (taken from demo project), to get time and date:
            RTC_TIME_AND_DATE td;
            rtcGetTimeAndDate(&td, 0);  //Get time and date in standard binary format
            printf("\nTime: %02d:%02d:%02d, Date: %02d-%02d-%d", td.hour, td.min, td.sec, td.day, td.month, td.year+2000);

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #5 on: May 04, 2014, 05:56:18 PM »
Hi modtro2,

I got this error ...

"../../../netcruzer/lib/nz_netcruzer.c:35:23: fatal error: nzos_main.h: No such file or directory"

I can't find nzos_main.h in the new library or anywhere.

Regards,
Bua

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #6 on: May 04, 2014, 06:59:02 PM »
I found the nzos_main.h in the RTOS folder, but I still have warnings and error due to the modification of the library.  Each time I update library, it is a pain  :-(.

Here are my warning and error message.

../../../microchip/TCPIP Stack/HTTP2.c: In function 'HTTPProcess':
../../../microchip/TCPIP Stack/HTTP2.c:809:17: warning: implicit declaration of function 'nz_memcpy'

../main.c: In function '_CNInterrupt':
../main.c:79:5: warning: implicit declaration of function 'clearIntOnChangeIF'
../main.c: In function 'main':
../main.c:105:5: warning: implicit declaration of function 'configIntOnChange'
../main.c:105:23: error: 'INT_ENABLE' undeclared (first use in this function)
../main.c:105:23: note: each undeclared identifier is reported only once for each function it appears in
../main.c:105:34: error: 'INT_PRI_4' undeclared (first use in this function)
../main.c:107:5: warning: implicit declaration of function 'enableIntOnChangeForPort'

Regards,


modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #7 on: May 04, 2014, 07:13:01 PM »
Hi Bua

Best will be if I send you the whole "Netcruzer Download" zipped file. You can than just add your code to it. Will that work? How many files did you modify for your project?

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #8 on: May 04, 2014, 07:29:16 PM »
Hi

There are more than a few files I modified, but it would be better if I get the rest of the code as well.

After I fixed all those warning and error, I got more...

build/WEBSERVER_SBC66EC_R2/production/_ext/265671525/nz_netcruzer.o(.libc.write+0x18): In function `.L14':
: undefined reference to `_serUSBIsSuspended'
build/WEBSERVER_SBC66EC_R2/production/_ext/265671525/nz_netcruzer.o(.libc.write+0x1a): In function `.L14':
: undefined reference to `_serUSBIsSuspended'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdExecNameValueCmd.cmdExecNameValueCmd+0x172): In function `.L82':
: undefined reference to `_nz_asciiHexNibbleToByte'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdExecNameValueCmd.cmdExecNameValueCmd+0x174): In function `.L82':
: undefined reference to `_nz_asciiHexNibbleToByte'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdExecNameValueCmd.cmdExecNameValueCmd+0x184): In function `.LSM215':
: undefined reference to `_nz_asciiHexNibbleToByte'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdExecNameValueCmd.cmdExecNameValueCmd+0x186): In function `.LSM215':
: undefined reference to `_nz_asciiHexNibbleToByte'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdExecNameValueCmd.cmdExecNameValueCmd+0x2cc): In function `.LSM270':
: undefined reference to `_nz_asciiHexToByte'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdExecNameValueCmd.cmdExecNameValueCmd+0x2ce): In function `.LSM270':
: undefined reference to `_nz_asciiHexToByte'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x218): In function `.L49':
: undefined reference to `_nz_uitoa'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x21a): In function `.L49':
: undefined reference to `_nz_uitoa'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x23e): In function `.L47':
: undefined reference to `_nz_highNibbleToAsciiHex'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x240): In function `.L47':
: undefined reference to `_nz_highNibbleToAsciiHex'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x24c): In function `.LSM129':
: undefined reference to `_nz_lowNibbleToAsciiHex'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x24e): In function `.LSM129':
: undefined reference to `_nz_lowNibbleToAsciiHex'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x26a): In function `.LSM131':
: undefined reference to `_nz_highNibbleToAsciiHex'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x26c): In function `.LSM131':
: undefined reference to `_nz_highNibbleToAsciiHex'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x280): In function `.LSM132':
: undefined reference to `_nz_lowNibbleToAsciiHex'
build/WEBSERVER_SBC66EC_R2/production/_ext/1472/cmd.o(.text.cmdGetTag.cmdGetTag+0x282): In function `.LSM132':
: undefined reference to `_nz_lowNibbleToAsciiHex'

Thanks,

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #9 on: May 04, 2014, 07:40:03 PM »
Hi Bua

I will send you the whole zipped project. Best is if you place a comment in each file you modify, so you can do a search for all modified files when upgrading to new firmware.

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #10 on: May 04, 2014, 08:14:45 PM »
Hi

Thank you.  Now I have only these two error left, but I can't fixed it.

build/WEBSERVER_SBC66EC_R2/production/_ext/265671525/nz_netcruzer.o(.libc.write+0x18): In function `.L14':
: undefined reference to `_serUSBIsSuspended'
build/WEBSERVER_SBC66EC_R2/production/_ext/265671525/nz_netcruzer.o(.libc.write+0x1a): In function `.L14':
: undefined reference to `_serUSBIsSuspended'

I looked at nz_serUSB.c, some how the function is not activate.

I will try your new version of the webserver project as well.  Thanks.

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #11 on: May 04, 2014, 08:21:31 PM »
The original instructions in this post for adding RTC to a project was for simple projects (like all the demo projects). Not for the webserver project. The webserver project has some other files that were also modified that work together with the library. I attached all current webserver files in a zipped file for you. The serUSBIsSuspended() is in the "serportUSB.c" file.

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #12 on: May 04, 2014, 08:26:53 PM »
Sorry laughing too soon.

Got this error...

../../../netcruzer/lib/nz_netcruzer.h:89:29: fatal error: ../rtos/nz_rtos.h: No such file or directory

I can't find the file anywhere in the webserver project.
« Last Edit: May 04, 2014, 11:00:49 PM by Bua »

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #13 on: May 05, 2014, 04:30:14 PM »
Hi, I put the current V2.03 beta with all files on the server:
http://www.netcruzer.com/temp/netcruzer_v203_src.zip

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: Does Real time clock in netcruzer library V203 work?
« Reply #14 on: May 06, 2014, 06:30:39 PM »
Still got this error

build/WEBSERVER_SBC66EC_R2/production/_ext/353927482/nzos_main.o(.text.nzRtosInit.nzRtosInit+0x2): In function `.LSM2':
: undefined reference to `_nzFbrInit'
build/WEBSERVER_SBC66EC_R2/production/_ext/353927482/nzos_main.o(.text.nzRtosInit.nzRtosInit+0x4): In function `.LSM2':
: undefined reference to `_nzFbrInit'

I can't find a definition of nzFbrInit, I saw only its prototype in the nzos_defsInternal.h. 

Any ideas?

Regards,
« Last Edit: May 06, 2014, 06:34:31 PM by Bua »