RTC convert TimStr and MiniSter and SecStr to Float format
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
RTC convert TimStr and MiniSter and SecStr to Float format
Hi everybody
How to convert TimStr and MiniSter and SecStr to Float format?
Have tried but not succeed!
I want to convert String to Float, must use Float format!
Must use HOUR FP and MIN FP and Sec FP... FLOAT format
Do you have a suggestion?
HOUR_FP = StringToFloat$ (TimeStr)
MIN_FP = StringToFloat$ (MinStr)
Sec_FP = StringToFloat$ (SecStr) See attached file below! If you have a proposal then I will be very happy;-)
How to convert TimStr and MiniSter and SecStr to Float format?
Have tried but not succeed!
I want to convert String to Float, must use Float format!
Must use HOUR FP and MIN FP and Sec FP... FLOAT format
Do you have a suggestion?
HOUR_FP = StringToFloat$ (TimeStr)
MIN_FP = StringToFloat$ (MinStr)
Sec_FP = StringToFloat$ (SecStr) See attached file below! If you have a proposal then I will be very happy;-)
Best Regard
Monie
Monie
- 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: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Monie,
Looks like you need to call the PrintString command instead of the PrintASCII command which will simply print out a single character.
The StringToFloat$ function can be used to specify the number of decimal points, for example if you want 2 "0.00".
HOUR_FP = StringToFloat$ (TimeStr, 2)
MIN_FP = StringToFloat$ (MinStr, 2)
Sec_FP = StringToFloat$ (SecStr, 2)
Hope this helps.
Looks like you need to call the PrintString command instead of the PrintASCII command which will simply print out a single character.
The StringToFloat$ function can be used to specify the number of decimal points, for example if you want 2 "0.00".
HOUR_FP = StringToFloat$ (TimeStr, 2)
MIN_FP = StringToFloat$ (MinStr, 2)
Sec_FP = StringToFloat$ (SecStr, 2)
Hope this helps.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Benj
Have tried with the error message, the picture below!
Do you have a suggestion.
Or can you see where is going wrong?
Or is my fault
Have tried with the error message, the picture below!
Do you have a suggestion.
Or can you see where is going wrong?
Or is my fault
Best Regard
Monie
Monie
- 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: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Monie,
Sorry the extra optional parameter is used for FloatToString$ not StringToFloat$, sorry for the confusion.
You maybe need to use an additional string variable, e.g. called TempStr and then load the string data bytes from the TimeStr into the TempStr.
Sorry the extra optional parameter is used for FloatToString$ not StringToFloat$, sorry for the confusion.
You maybe need to use an additional string variable, e.g. called TempStr and then load the string data bytes from the TimeStr into the TempStr.
Code: Select all
TempStr[0] = TimeStr[0]
TempStr[1] = TimeStr[1]
TempStr[2] = 0
HOUR_FP = StringToFloat$ (TempStr)
TempStr[0] = TimeStr[2]
TempStr[1] = TimeStr[3]
TempStr[2] = 0
MIN_FP = StringToFloat$ (TempStr)
TempStr[0] = TimeStr[4]
TempStr[1] = TimeStr[5]
TempStr[2] = 0
Sec_FP = StringToFloat$ (TempStr)
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Benj
Thank you very much for your proposal.
Very nice suggestion it just worked ..
But of course there is a problem more ..
The first LOOP / Calculates Time, Minute and Second - very fine
But the next LOOP calculates Elevation and Azimuth.
The problem here is that only by resetting is the value of Elevation and Azimuth updated.
The value of Elevation and Azimuth will not be updated.
Do you have a suggestion for updating Elevation and Azimuth?
Has attached MIAC dsPICSetting SolarTracker:
Thank you very much for your proposal.
Very nice suggestion it just worked ..
But of course there is a problem more ..
The first LOOP / Calculates Time, Minute and Second - very fine
But the next LOOP calculates Elevation and Azimuth.
The problem here is that only by resetting is the value of Elevation and Azimuth updated.
The value of Elevation and Azimuth will not be updated.
Do you have a suggestion for updating Elevation and Azimuth?
Has attached MIAC dsPICSetting SolarTracker:
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi everybody
Does anyone here have a suggestion for the last question "The value of Elevation and Azimuth will not be updated."
Does anyone here have a suggestion for the last question "The value of Elevation and Azimuth will not be updated."
Best Regard
Monie
Monie
- 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: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Monie,
Are your loops in Main correct? You seem to loop to do the keypad and then loop forever after that. So I imagine you need to reset the program to get back to the keypad entry.
Are your loops in Main correct? You seem to loop to do the keypad and then loop forever after that. So I imagine you need to reset the program to get back to the keypad entry.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Benj
Yes, that's right you describe.
Yes, I need to reset the program to get one updated Elevation and Azimuth...
I do not get any updates, do it manually.
Yes, that's right you describe.
Yes, I need to reset the program to get one updated Elevation and Azimuth...
I do not get any updates, do it manually.
Best Regard
Monie
Monie
- 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: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Monie,
This line might be a problem.
Try instead this, e.g. ".0" after integer constant numbers when used in Float calculations.
Also these two lines.
Would become.
This line might be a problem.
Code: Select all
HOUR_FP = HOUR_FP + fdiv (MIN_FP,60) + fdiv (SEC_FP,3600)
Code: Select all
HOUR_FP = HOUR_FP + fdiv (MIN_FP, 60.0) + fdiv (SEC_FP, 3600.0)
Code: Select all
delta_FP = fadd (delta_FP,fdiv (HOUR_FP,24))
time = fsub (delta_FP,51545)
Code: Select all
delta_FP = fadd (delta_FP,fdiv (HOUR_FP, 24.0))
time = fsub (delta_FP, 51545.0)
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Benj
Thanks for the information of works.
Notifies you of the result.
Good weekend
Thanks for the information of works.
Notifies you of the result.
Good weekend
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Benj
Have inserted codes, you have to write fine.
But it didn't work, still can't see any changes updating printing of Elevation and Azimuth?
Compiles Messages:
With many warning: passing argument...
Has attached MIAC dsPICSetting SolarTracker - with your updates:
Have inserted codes, you have to write fine.
But it didn't work, still can't see any changes updating printing of Elevation and Azimuth?
Compiles Messages:
Code: Select all
Target folder: C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4
Source name: C:\Users\sun\OneDrive\Documents\MIAC dsPIC Tracker\MIAC dsPICSetting SolarTracker.fcfx
Title:
Description:
Device: PIC16.33E.MIAC (dsPIC) System
Generated by: Flowcode v8.1.1.11
Date: Friday, February 22, 2019 15:32:29
Users: 1
Registered to: monie jacobsen
License key: X6U4U7
https://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_comp.bat "MIAC dsPICSetting SolarTracker" "C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4\" "33EP256MU806"
C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4>xc16-gcc -c -mcpu="33EP256MU806" -omf=coff -funsigned-char -fno-short-double -Os -I"C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic16\BATCHF~1\..\support\h" -I"C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic16\BATCHF~1\" -std=gnu99 "MIAC dsPICSetting SolarTracker".c -o "MIAC dsPICSetting SolarTracker".o
Options have been disabled due to restricted license
Visit http://www.microchip.com/ to purchase a new key.
MIAC dsPICSetting SolarTracker.c: In function 'FCM_Display_On_OFF':
MIAC dsPICSetting SolarTracker.c:1955:3: warning: passing argument 1 of 'MIAC_PrintString' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:390:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:1972:3: warning: passing argument 1 of 'MIAC_PrintString' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:390:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:1993:3: warning: passing argument 1 of 'MIAC_PrintString' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:390:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:2010:3: warning: passing argument 1 of 'MIAC_PrintString' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:390:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c: In function 'FCM_Solar_position':
MIAC dsPICSetting SolarTracker.c:2950:2: warning: passing argument 3 of 'FCI_FLOAT_TO_STRING' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:562:18: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:2951:2: warning: passing argument 3 of 'FCI_FLOAT_TO_STRING' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:562:18: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:2958:2: warning: passing argument 3 of 'FCI_FLOAT_TO_STRING' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:562:18: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:2959:2: warning: passing argument 3 of 'FCI_FLOAT_TO_STRING' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:562:18: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c: In function 'FCM_SetTime':
MIAC dsPICSetting SolarTracker.c:2980:2: warning: passing argument 1 of 'FCD_06ae1_rtc1__GetTime' discards qualifiers from pointer target type
MIAC dsPICSetting SolarTracker.c:695:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:3127:5: warning: passing argument 1 of 'FCD_06ae1_rtc1__SetTime' discards qualifiers from pointer target type
MIAC dsPICSetting SolarTracker.c:648:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c: In function 'FCM_SetDate':
MIAC dsPICSetting SolarTracker.c:3913:2: warning: passing argument 1 of 'FCD_06ae1_rtc1__GetDate' discards qualifiers from pointer target type
MIAC dsPICSetting SolarTracker.c:814:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4060:5: warning: passing argument 1 of 'FCD_06ae1_rtc1__SetDate' discards qualifiers from pointer target type
MIAC dsPICSetting SolarTracker.c:777:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c: In function 'FCM_DayOfTheWeek':
MIAC dsPICSetting SolarTracker.c:4455:4: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:904:13: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4463:4: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:904:13: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4471:4: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:904:13: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4479:4: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:904:13: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4487:4: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:904:13: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4495:4: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:904:13: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4503:4: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:904:13: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c: In function 'main':
MIAC dsPICSetting SolarTracker.c:4646:3: warning: passing argument 1 of 'FCD_06ae1_rtc1__GetTime' discards qualifiers from pointer target type
MIAC dsPICSetting SolarTracker.c:695:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4652:3: warning: passing argument 1 of 'FCD_06ae1_rtc1__GetDate' discards qualifiers from pointer target type
MIAC dsPICSetting SolarTracker.c:814:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4673:3: warning: passing argument 1 of 'FCI_STRING_TO_INT' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:693:18: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4677:3: warning: passing argument 1 of 'FCI_STRING_TO_INT' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:693:18: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
MIAC dsPICSetting SolarTracker.c:4681:3: warning: passing argument 1 of 'FCI_STRING_TO_INT' discards qualifiers from pointer target type
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_String.c:693:18: note: expected 'MX_STRING' but argument is of type 'volatile MX_CHAR *'
. . .
Compilation successful!
Launching the linker/assembler...
C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_link.bat "C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4\MIAC dsPICSetting SolarTracker" 33EP256MU806 33E
.
xc16-ld 1.26 (A)
Program Memory [Origin = 0x200, Length = 0x2aa00]
section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
.text 0x200 0x8da 0xd47 (3399)
.const 0xada 0x5c0 0x8a0 (2208)
.text 0x109a 0x428e 0x63d5 (25557)
.dinit 0x5328 0x2e 0x45 (69)
Total program memory used (bytes): 0x7a01 (31233) 11%
Auxflash Memory [Origin = 0x7fc000, Length = 0x3ffa]
section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
Total auxflash memory used (bytes): 0 (0) <1%
Data Memory [Origin = 0x1000, Length = 0x7000]
section address alignment gaps total length (dec)
------- ------- -------------- -------------------
.nbss 0x1000 0 0x194 (404)
.ndata 0x1194 0 0x8 (8)
.nbss 0x119c 0 0x2 (2)
.bss 0x119e 0 0x6e (110)
.data 0x120c 0 0xc (12)
Total data memory used (bytes): 0x218 (536) 1%
Dynamic Memory Usage
region address maximum length (dec)
------ ------- ---------------------
heap 0 0 (0)
stack 0x1218 0x6de8 (28136)
Maximum dynamic memory (bytes): 0x6de8 (28136)
Generating HEX file
C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4>xc16-bin2hex -omf=coff "C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4\MIAC dsPICSetting SolarTracker".cof
Generating Assembler file
C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4>xc16-objdump -omf=coff -S "C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4\MIAC dsPICSetting SolarTracker".cof 1>"C:\Users\sun\OneDrive\DOCUME~1\MIACDS~4\MIAC dsPICSetting SolarTracker".asm
. . . . . . .
HEX file creation successful!
Launching the programmer...
C:\Program Files (x86)\Flowcode v8\tools\mLoader\mLoader.exe -miacdsp16 "MIAC dsPICSetting SolarTracker.hex"
Loading file...
File loaded from...
=> MIAC dsPICSetting SolarTracker.hex
File sending...
. . . .
File sent!
FINISHED
Has attached MIAC dsPICSetting SolarTracker - with your updates:
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi everybody
Can one implant RTC MCP7940N in a MACRO or INTERRUPT.
So can RTC provide data to locations outside MACRO devices?
Can one implant RTC MCP7940N in a MACRO or INTERRUPT.
So can RTC provide data to locations outside MACRO devices?
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi everybody
Have tried many days with getting attached file to work, but it is not successful yet!
Is there anyone here who has a proposal all suggestions are very welcome?
Description:
Want to be able to edit DATE and Clock on startup.
And then leave the setup and print elevation azimuth in a new "loop". Has attached MIAC dsPICSetting SolarTracker - with updates version!
Have tried many days with getting attached file to work, but it is not successful yet!
Is there anyone here who has a proposal all suggestions are very welcome?
Description:
Want to be able to edit DATE and Clock on startup.
And then leave the setup and print elevation azimuth in a new "loop". Has attached MIAC dsPICSetting SolarTracker - with updates version!
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi everybody
Can I use EEPROM 3 click? Along with Miac dsPIC
Where Date Time can be saved and read from elsewhere in the codes?
https://www.mikroe.com/eeprom-3-click
If EEPROM 3 can be used with Miac dsPIC (MI5009) how to connect EEPROM 3.
Would you like to help with a description of the connection between Miac dsPIC and EEPROM 3 ????
Can I use EEPROM 3 click? Along with Miac dsPIC
Where Date Time can be saved and read from elsewhere in the codes?
https://www.mikroe.com/eeprom-3-click
If EEPROM 3 can be used with Miac dsPIC (MI5009) how to connect EEPROM 3.
Would you like to help with a description of the connection between Miac dsPIC and EEPROM 3 ????
Best Regard
Monie
Monie
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Monie,
That Click EEPROM would require I2C.
The dsPIC MIAC does not directly have an I2C interface, but it could be done via a System Addon Module with I2C,
such as the Advanced Module or the Serial Module.
Another option would be to use the SD card of the Serial Addon Module.
Did you know that the dsPIC already has an internal 24C32, 32Kbyte EEPROM that can be used for storage?
That Click EEPROM would require I2C.
The dsPIC MIAC does not directly have an I2C interface, but it could be done via a System Addon Module with I2C,
such as the Advanced Module or the Serial Module.
Another option would be to use the SD card of the Serial Addon Module.
Did you know that the dsPIC already has an internal 24C32, 32Kbyte EEPROM that can be used for storage?
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
HI LeighM
No, I did not show that dsPIC has an internal 24C32, 32Kbyte EEPROM
Have searched a lot on Flowcode forum.
Of course I would like to use this internal EEPROM. OK
Do you want to help with an example of Save and Load - retrieve data from the EEPROM dsPIC has an internal EEPROM.
No, I did not show that dsPIC has an internal 24C32, 32Kbyte EEPROM

Have searched a lot on Flowcode forum.
Of course I would like to use this internal EEPROM. OK
Do you want to help with an example of Save and Load - retrieve data from the EEPROM dsPIC has an internal EEPROM.
Best Regard
Monie
Monie
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Add "Serial EEPROM (24C32)" component from the "Data" menu, into your project.
Then use Read and Write macros to access the Data bytes at your chosen Address in the EEPROM.
Then use Read and Write macros to access the Data bytes at your chosen Address in the EEPROM.
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
HI LeighM
Have here tried to make EEPROM work but without success.
But get a lot of error messages?
Can you see where it goes wrong.
And you have a suggestion!
Compiler Messags:
Attached files:
Have here tried to make EEPROM work but without success.
But get a lot of error messages?
Can you see where it goes wrong.
And you have a suggestion!
Compiler Messags:
Code: Select all
Target folder: C:\Users\sun\Desktop
Source name: C:\Users\sun\Desktop\MIAC dsPIC Menu Flash-003.fcfx
Title:
Description:
Device: PIC16.33E.MIAC (dsPIC) System
Generated by: Flowcode v8.1.1.11
Date: Monday, March 04, 2019 12:19:21
Users: 1
Registered to: monie jacobsen
License key: X6U4U7
https://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_comp.bat "MIAC dsPIC Menu Flash-003" "C:\Users\sun\Desktop\" "33EP256MU806"
C:\Users\sun\Desktop>xc16-gcc -c -mcpu="33EP256MU806" -omf=coff -funsigned-char -fno-short-double -Os -I"C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic16\BATCHF~1\..\support\h" -I"C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic16\BATCHF~1\" -std=gnu99 "MIAC dsPIC Menu Flash-003".c -o "MIAC dsPIC Menu Flash-003".o
Options have been disabled due to restricted license
Visit http://www.microchip.com/ to purchase a new key.
MIAC dsPIC Menu Flash-003.c:142:13: error: expected declaration specifiers or '...' before numeric constant
MIAC dsPIC Menu Flash-003.c: In function '_EEDATA':
MIAC dsPIC Menu Flash-003.c:142:16: error: expected declaration specifiers before 'NonVolatileData'
MIAC dsPIC Menu Flash-003.c:142:78: error: expected declaration specifiers before ';' token
MIAC dsPIC Menu Flash-003.c:304:1: error: parameter 'WG_CharMap' is initialized
MIAC dsPIC Menu Flash-003.c:306:1: warning: excess elements in scalar initializer
MIAC dsPIC Menu Flash-003.c:306:1: warning: (near initialization for 'WG_CharMap')
MIAC dsPIC Menu Flash-003.c:306:1: warning: excess elements in scalar initializer
MIAC dsPIC Menu Flash-003.c:306:1: warning: (near initialization for 'WG_CharMap')
MIAC dsPIC Menu Flash-003.c:306:1: warning: excess elements in scalar initializer
MIAC dsPIC Menu Flash-003.c:306:1: warning: (near initialization for 'WG_CharMap')
MIAC dsPIC Menu Flash-003.c:434:1: warning: excess elements in scalar initializer
MIAC dsPIC Menu Flash-003.c:434:1: warning: (near initialization for 'WG_CharMap')
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:46:0,
from MIAC dsPIC Menu Flash-003.c:451:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:53:17: error: storage class specified for parameter 'WG_CursorX'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:54:17: error: storage class specified for parameter 'WG_CursorY'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:56:13: error: storage class specified for parameter 'WG_Write'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:57:17: error: storage class specified for parameter 'WG_Read'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:58:13: error: storage class specified for parameter 'WG_Command'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:59:17: error: storage class specified for parameter 'WG_Status'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:60:13: error: storage class specified for parameter 'WG_WriteWordAt'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:61:18: error: storage class specified for parameter 'WG_ReadWordAt'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:65:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:109:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:157:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:172:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:187:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:204:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:225:17: error: storage class specified for parameter 'MIAC_SPI0_cs'
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:228:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:273:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:604:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:615:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:626:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:637:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:648:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:304:0,
from MIAC dsPIC Menu Flash-003.c:451:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_EEPROM.c:56:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_EEPROM.c:73:4: error: #error "Chip does not have EEPROM memory"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_EEPROM.c:78:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_EEPROM.c:134:4: error: #error "Chip does not have EEPROM memory"
MIAC dsPIC Menu Flash-003.c:474:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:495:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:520:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:531:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:547:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:1338:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:1403:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:1450:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:3236:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:3301:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:3323:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:3435:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
MIAC dsPIC Menu Flash-003.c:3629:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_EEPROM.c:45:6: error: declaration for parameter 'FC_CAL_EE_Write' but no such parameter
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_EEPROM.c:44:11: error: declaration for parameter 'FC_CAL_EE_Read' but no such parameter
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:225:17: error: declaration for parameter 'MIAC_SPI0_cs' but no such parameter
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:61:18: error: declaration for parameter 'WG_ReadWordAt' but no such parameter
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:60:13: error: declaration for parameter 'WG_WriteWordAt' but no such parameter
IAC\MIAC_CAL_API.c:54:17: error: declaration for parameter 'WG_CursorY' but no such parameter
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/MIAC\MIAC_CAL_API.c:53:17: error: declaration for parameter 'WG_CursorX' but no such parameter
MIAC dsPIC Menu Flash-003.c:446:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__OutputON' but no such parameter
MIAC dsPIC Menu Flash-003.c:445:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__OutputOFF' but no such parameter
MIAC dsPIC Menu Flash-003.c:444:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__RelayON' but no such parameter
MIAC dsPIC Menu Flash-003.c:443:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__LED_Off' but no such parameter
MIAC dsPIC Menu Flash-003.c:442:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__CheckCursor' but no such parameter
MIAC dsPIC Menu Flash-003.c:441:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__LED_On' but no such parameter
MIAC dsPIC Menu Flash-003.c:440:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__DrawRect' but no such parameter
MIAC dsPIC Menu Flash-003.c:439:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__PrintFormattedNumber' but no such parameter
MIAC dsPIC Menu Flash-003.c:438:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__DrawLine' but no such parameter
MIAC dsPIC Menu Flash-003.c:437:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__PrintNumber' but no such parameter
MIAC dsPIC Menu Flash-003.c:436:6: error: declaration for parameter 'FCD_0bf41_miac_dspic1__RelayOFF' but no such parameter
MIAC dsPIC Menu Flash-003.c:304:16: error: declaration for parameter 'WG_CharMap' but no such parameter
MIAC dsPIC Menu Flash-003.c:287:6: error: declaration for parameter 'FCD_04c91_led_q1__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:286:6: error: declaration for parameter 'FCD_04c91_led_q1__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:279:6: error: declaration for parameter 'FCD_04c92_led_q2__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:278:6: error: declaration for parameter 'FCD_04c92_led_q2__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:271:6: error: declaration for parameter 'FCD_04c93_led_q3__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:270:6: error: declaration for parameter 'FCD_04c93_led_q3__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:263:6: error: declaration for parameter 'FCD_04c94_led_q4__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:262:6: error: declaration for parameter 'FCD_04c94_led_q4__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:255:6: error: declaration for parameter 'FCD_04c95_led_a__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:254:6: error: declaration for parameter 'FCD_04c95_led_a__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:247:6: error: declaration for parameter 'FCD_04c96_led_b__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:246:6: error: declaration for parameter 'FCD_04c96_led_b__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:239:6: error: declaration for parameter 'FCD_04c97_led_c__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:238:6: error: declaration for parameter 'FCD_04c97_led_c__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:231:6: error: declaration for parameter 'FCD_04c98_led_in1__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:191:6: error: declaration for parameter 'FCD_09f04_led_in6__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:190:6: error: declaration for parameter 'FCD_09f04_led_in6__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:183:6: error: declaration for parameter 'FCD_09f05_led_in7__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:182:6: error: declaration for parameter 'FCD_09f05_led_in7__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:175:6: error: declaration for parameter 'FCD_09f06_led_in8__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:174:6: error: declaration for parameter 'FCD_09f06_led_in8__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:167:6: error: declaration for parameter 'FCD_04c9a_led_d__LEDOff' but no such parameter
MIAC dsPIC Menu Flash-003.c:166:6: error: declaration for parameter 'FCD_04c9a_led_d__LEDOn' but no such parameter
MIAC dsPIC Menu Flash-003.c:147:6: error: declaration for parameter 'FCD_06651_eeprom1__Write' but no such parameter
MIAC dsPIC Menu Flash-003.c:146:11: error: declaration for parameter 'FCD_06651_eeprom1__Read' but no such parameter
MIAC dsPIC Menu Flash-003.c:3632:2: error: expected '{' at end of input
Error returned from [xc16-gcc.exe]
.
C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_comp.bat reported error code 1
FINISHED
Best Regard
Monie
Monie
- 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: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Monie,
I think you're using the wrong EEPROM component there. You are using the internal EEPROM component which isn't available on the dsPIC MIAC.
The dsPIC MIAC however does have an external EEPROM which requires the Serial EEPROM (24C32) component.
I think you're using the wrong EEPROM component there. You are using the internal EEPROM component which isn't available on the dsPIC MIAC.
The dsPIC MIAC however does have an external EEPROM which requires the Serial EEPROM (24C32) component.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi Benj
Has added "Serial EEPROM (24C32)" component...
Want to print as Elevation: 25.2 Grades
And Azimuth as 205.5 Grades
Would you like to help with an example?
I'm thinking I'm doing something wrong
And Please see attached file:
Has added "Serial EEPROM (24C32)" component...
Want to print as Elevation: 25.2 Grades
And Azimuth as 205.5 Grades
Would you like to help with an example?
I'm thinking I'm doing something wrong
And Please see attached file:
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi everybody
Is there anyone here who can give me a code example of setup serial eeprom.
Please see above attached file!
Is there anyone here who can give me a code example of setup serial eeprom.
Please see above attached file!
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi LeighM
One return the values?
I do not know what you mean.
There must return a Code and how it is written.
One return the values?
I do not know what you mean.
There must return a Code and how it is written.
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC convert TimStr and MiniSter and SecStr to Float format
Hi LeighM
Thank you very much.
Display not updated?
Display update only when resetting dsPIC
Do you have a suggestion for the problem here?
Attached file:
Thank you very much.
Display not updated?
Display update only when resetting dsPIC
Do you have a suggestion for the problem here?
Attached file:
Best Regard
Monie
Monie