Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - internal error at line 405 file 'avr.cpp'

(you are viewing a thread; or go back to list of threads)

internal error at line 405 file 'avr.cpp' (by simon)
Hi Jonathan

I have this timer program and the problem is that i need to set up one counter to value '43000' and the biggest value accepted is '32000' . How can solve the problem ?

Thank you .
Mon Mar 1 2010, 02:59:42, download attachment releu astabil.ld
(no subject) (by Jonathan Westhues)
LDmicro uses 16 bit signed integer math. This means that the most positive number representable is 2^15 - 1 = 32767, and the most negative is -2^15 = -32768.

So there is no way to represent a number greater than 32767. I would suggest working in different units, or cascading multiple counters, or otherwise writing the code to avoid numbers that cannot be represented as 16 bit signed integers.

Though it's a bug that you don't get a nice warning, as you do for other ops.
Tue Mar 2 2010, 22:44:14
no subject (by simon)
Tank you Jonathan

I will remember this on the next programs .
Wed Mar 3 2010, 08:43:07
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):