Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to use int64_t type in PinGuino
24-07-2013, 02:51 PM,
#1
how to use int64_t type in PinGuino
Hello All,

Greetings from India..

This is my first post in the Pinguino Forum, Please excuse for any mistakes ..

I was experimenting with the home brewed Pinguino (18F4550 Version) . I am able to interface the 20X4 LCD, 3X4 keypad and some other peripherals without any problems. I want to use int64_t type to do some arithmetic related a new experiment (Interfacing the AD9851 DDS) . When I use the int64_t type in the program , the compilation is not happening.. Do I need to add any specific headers for this? I have even tried to use the int32_t without success.. Any help is appreciated in this topic..

Thanks and Regards

Vinod
Reply
24-07-2013, 03:10 PM,
#2
RE: how to use int64_t type in PinGuino
Are they supported by the compiler? You're using a chip that's really 8-bit/16-bit so what you want is unusual. Check the compiler documentation.

John
Reply
24-07-2013, 04:52 PM,
#3
RE: how to use int64_t type in PinGuino
http://wiki.pinguino.cc/index.php/Data_types
is just 2 clicks away (wiki, data types).

According to that table, you should use s64 or u64 rather than [unsigend] int32_t,
but I did not try this (since I still have no 8 bit pinguino yet). Just try!

For the same reason I cannot tell you how to avoid heavy in-text replacing within existing code, but I guess (from C language) that you could use either typedef or #define for this purpose.
Reply
24-07-2013, 04:59 PM, (This post was last modified: 24-07-2013, 05:00 PM by pingotg.)
#4
RE: how to use int64_t type in PinGuino
That page says 8-bit uses SDCC which doesn't do 64-bit at all.

John
Reply
24-07-2013, 05:11 PM,
#5
RE: how to use int64_t type in PinGuino
Thanks for the Information.

I had a look in to the http://wiki.pinguino.cc/index.php/Data_types..

It seems the types s64 and u64 are not for Pinguino8.. Smile

Regards,

Vinod
Reply
24-07-2013, 05:25 PM,
#6
RE: how to use int64_t type in PinGuino
Sorry, I didn't know (that SDCC doesn't do 64-bit, and the SDCC manual link is dead) and the text "Pinguino also includes the following .. integer data types" sounds like there was an EXTENSION to the general pinguino type system. This makes it misleading. I got the impression that in many cases "Pinguino" actually refers to Pinguino32 only - without telling so. I know that the system has grown and understand that keeping documentation up to date is really cumbersome and I really don't want to complain, but i fear it is just that type of "hidden knowledge" that tends to grow into some barrier of frustration for newbies.
Reply
24-07-2013, 05:38 PM,
#7
RE: how to use int64_t type in PinGuino
I have tried to use the s64 and u64 for the Pinguino32 ( in X4 IDE) and the code is compiled without any problems...

Seems like the Term "Pinguino" defaults to Pinguino32 Smile

Anyway, It is a learning for me... So In future programs I can think of the data types based on the SDCC Version ...
Reply
24-07-2013, 05:41 PM,
#8
RE: how to use int64_t type in PinGuino
By the way, in many cases you can AVOID higher precission integer arithmethics, for instances by resorting your arithmetic operations - or even by using 32 bit floating point (which optimises mantissa bit usage). Sounds strange (as usually I am not getting tired arguing the other way round: use integers as long as possible) but for special cases, this may be a clever solution. As long as you keep in mind that floats may be tricky, especially when adding or subtracting numbers with very different sizes.
Reply
24-07-2013, 05:44 PM,
#9
Thumbs Up  RE: how to use int64_t type in PinGuino
Yep, Thanks for the hint..
Reply
24-07-2013, 09:26 PM, (This post was last modified: 24-07-2013, 09:26 PM by iyahdub.)
#10
RE: how to use int64_t type in PinGuino
I was actually looking into variable type defs of the pic32 last few days, and its min/max values ( limits.h). Microchip advises you to use the ones in stdint.h is you need fixed values, given its based on GCC, and therefore has to complay with ANSI and CCI standards .
Pinguino is a project based on the good will and time availability of the community ! For which we all give thanks for !
So, there is a lot to be done, still... But, im sure you will learn a lot by doing some research, and become a better programmer and designer in the process.
Personally i love doing it !
Wink
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)