64-bit variable on Imagecraft 8 AVR comiler

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

is the a way to process a 64-bit unsigned Long Long variable on this Compiler,

i have the advanced Version, but i find no way to do this.

 

Best regrads,

Thomas

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The available data types and their sizes are listed in Table 1 on page 171 of the PDF manual: 

 

https://imagecraft.com/documentation/jumpstart-c-documentation

 

The largest is clearly 32 bits (4 bytes).

 

Note that there is a contact address for support on page 12 - under "Support".

 

Do you really need 64-bit  arithmetic - on a little, eight-bit microcontroller ??!

 

If you do, your choices are

 

  1. Choose a different  compiler;
  2. Create your own functions (will probably need to be in assembler).

 

Or, of course, switch to a different processor...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

long long is in AVR GCC with 64b signed and unsigned fixed point arithmetic :

https://gcc.gnu.org/wiki/avr-gcc#Type_Layout

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ernesti001 wrote:

...to process a 64-bit unsigned Long Long variable...

 

What 'processes' do you need to do?

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
long long is in AVR GCC with 64b signed and unsigned fixed point arithmetic

For the avoidance of doubt, long long is an integer type; the fixed-point arithmetic can make use of it

 

EDIT

 

What I mean is, long long is not just for fixed-point arithmetic

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Sat. Sep 30, 2017 - 12:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can handle 64 bit integers with uint64_t (or int64_t) with 8bit AVR in the GCC environment.
Is that strange?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No - see #3

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

He says he wants to handle 64bit variables.
Giving up the use of 64bit variables is only a temporary one.

To give up if he sticks to the compiler.
Otherwise it is better to change the compiler.
Do not you think so?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kabasan wrote:
He says he wants to handle 64bit variables.

But he hasn't said why - nor what kind of "handling" he wants to do

 

It could be that it isn't actually necessary at all ...

 

Giving up the use of 64bit variables is only a temporary one.

What do you mean by that?

 

As noted in #2, he could do it "manually"

 

Otherwise it is better to change the compiler.
Do not you think so?

We don't know how important the in-built 64-bit support is relative to whatever other reasons he may have for choosing that particular compiler ...

 

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Sat. Sep 30, 2017 - 03:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seems a bit too fierce to change compilers just because of a lack of type that almost certainly is not required. If it really is you can build longer type support from what exists anyway. (cf Windows "LARGE_INTEGER")

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kabasan wrote:
I can handle 64 bit integers with uint64_t (or int64_t) with 8bit AVR in the GCC environment.
Reference :

http://www.nongnu.org/avr-libc/user-manual/group__avr__stdint.html

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

also, aparently, 24-bit:

 

AVR-GCC Wiki wrote:

Extensions

 

Types

 

  • Signed and unsigned 24-bit integers: __int24 (v4.7), __uint24 (v4.7).

https://gcc.gnu.org/wiki/avr-gcc...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ernesti001 wrote:

Hello,

 

is the a way to process a 64-bit unsigned Long Long variable on this Compiler,

i have the advanced Version, but i find no way to do this.

 

Best regrads,

Thomas

 

 

 

You should contact imagecraft support about this, as the compiler does support Long Long, but there seems to be a bug in the stdint.h that is missing int64_t and uint64_t for the AVR platform.

If I modify the header file, it works just fine!

 

Jim

 

Mission: Improving the readiness of hams world wide : flinthillsradioinc.com

Interests: Ham Radio, Solar power, futures & currency trading - whats yours?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
 there seems to be a bug in the stdint.h that is missing int64_t and uint64_t 

Also in the manuals - see #2.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...