pane

Jun 202020
 

https://jeelabs.org/2012/05/18/generating-a-sine-wave/

 

Generating a sine wave

In Hardware on May 18, 2012 at 00:01

After the recent pretty disappointing results with a transformer-based Component Tester, I’d like to try and generate a ± 10 V sine wave at approximately 50 Hz in some other way. Using as few components as possible.

 Posted by at 7:25 pm
Jun 202020
 

http://www.bristolwatch.com/

 

Arduino based digital clock.

Student-Hobbyist Electronics Projects Tutorials

by Lewis Loflin

 

View all of my You Tube Videos
Also visit and subscribe to My YouTube Channel

 

Introduction – The purpose of these pages is to introduce the student and hobbyist to electronics projects. My hope is generate interest for those thinking about entering a high tech field, or simply to have fun.

I’ve been a part-time adjunct professor at a local community college teaching electricity and electronics. My electronics website reflects what I’ve taught or been asked to look into by visitors. I have 40 years experience in electronics from vacuum tubes to modern solid state and industrial controls. In college I had a year each of physics, chemistry, and biology along with C, C++. Pascal, and assembly.

 Posted by at 6:37 pm
Jun 202020
 

http://www.sillanumsoft.org/prod01.htm

 

Detailed Features about:

  1. Oscilloscope (dual channel, xy, time division, trigger);

  2. Spectrum Analyzer with amplitude and phase display (linear, log, lines, bar, octaves band analysis 1/3, 1/6, 1/9, 1/12, 1/24);

  3. Wave-form generator with “custom functions”, triangular, square, sinus, white noise and pulse generation (NO ALIASING);

  4. Frequency meter (in time and frequency domain) and counter; in time domain by means of a real time zero crossing algorithm;

  5. Volt meter with DC, true RMS, peak to peak and mean display; 

  6. Filtering (low pass, hi pass, band pass, band reject, notch, “diode”, DC removal);

  7. Memo windows (data log) for analysis and storage of time series, spectrum and phase  with “triggering” events; possibility to save in various formats and display them with a viewer;

  8. A TRUE software digital analog conversion (for complete signal reconstruction using Nyquist theorem) ;

  9. Frequency compensation: one can create/edit a custom frequency response and  add it to the spectrum analyzer spectrum ; added standard weighting curves A,B,C in parallel with custom frequency response;

  10. Support for 8/16/24 bit soundcard by means of API calls;

  11. Unlimited frequency sampling (depend from the capabilities of your soundcard);

  12. Cepstrum analysis;

  13. Cross Correlation;

  14. Extended THD measurements, with automatic sweep and compensation.

  15. ZRLC-meter with Vector scope, automatic sweep in time and frequency for automatic measurement.

VA main form (version 8.x.x)

[Product Image]

(1) – Oscilloscope

Click to enlarge in a new window

  1. Dual channel

  2. Bandwith : depends from your soundcard (typical  20 Khz) up to 96 Khz (192 Khz sampling frequency)

  3. Resolution from 8 bit (S/N 46 dB) up to 24 bit (S/N >120 dB)

  4. Time division adjust according the sampling frequency and sample resolution

  5. Trigger (positive/negative slope) independent for both channels

  6. Complete software D/A of digital samples : the Nyquist theorem allows reconstructing exactly the input signal

  7. Utilities for quick frequency determination (hold left mouse button down and move mouse to get frequency/amplitude)

  8. Y-axis in Volt and percent full scale

  9. Auto calibration of scope (and spectrum) in volts (need an input signal of known amplitude)

(2) – Spectrum Analyzer

Click to enlarge in a new window

  1. Dual channel

  2. Bandwidth : same as point (1) (oscilloscope function): is the half of the sampling frequency. Typical for 44100 Hz is 22050 Hz (up to 96 Khz or ore depending of the acquisition board)

  3. Resolution from 8 bit (S/N 46 dB) up to 24 bit (S/N >120 dB)

  4. X-axis in Hz, logarithmic and linear; zoom x1..x16

  5. Y-axis in dB or Volt (calibration needed); linear/logarithmic; zoom

  6. Average on spectrum up to 200 buffer

  7. Direct window for amplitude  with mouse

  8. Auto-scale

  9. Capacity to modify the zero dB level  (manually/automatically)

  10. Octave band analysis (1/1, 1/3, 1/6, 1/9, 1/12, 1/24)

(3) – Wave-form generator

Click to enlarge in a new windowClick to enlarge in a new window

  • Dual channel

  • Independent sampling frequency/resolution from scope/spectrum (up to 192 Khz/24 bit)

  • Phase between channels (degree)

  • Direct real time generation/ loop with predefined buffer

  • Waveform CUSTOM, built with harmonics (with save/load in file “.fun” of defined waveform)

  • Modulation of custom waveform with sinus/square/triangular

  • Predefined waveform : sinus, square, triangular (parametric), white noise, pink noise, pulse, sinusoidal sweep 

  • Local volume levels

  • Real time parameters variation (amplitude, frequency, phase between channels, type of waveform)

(4) – Frequency meter

Click to enlarge in a new window

  • Dual channel

  • Frequency meter in Hz/Time/Counter of the input signal being visualized in spectrum/scope

  • Read the frequency of the harmonic of maximum amplitude

  • Counter with threshold level

(5) – Volt meter (calibration needed)

Click to enlarge in a new window

  • Dual channel

  • Vpp, True Rms

  • Hold function

(6) – Filtering

Click to enlarge in a new window

  • FIR low pass cut-off frequency user defined

  • FIR high pass cut-off frequency user defined

  • FIR band pass cut-off frequencies user defined

  • FIR band reject cut-off frequencies user defined

  • IIR notch cut-off frequency user defined

  • IIR notch-inverted cut-off frequency user defined

  • “Diode” function

  • DC removal

  • Dual filter (one for each channel)

(7) – Memo windows

Click to enlarge in a new windowClick to enlarge in a new window

  • Aquiring of spectrum with average

  • Edit offline (while VA running) of aquired spectrum: zoom, navigate

  • Saving of spectrum in TXT format

  • Clipboard for aquired spectrum

  • Print of aquired spectrum

  • Mark points for each valid point (harmonic) of spectrum

  • Aquiring of scope points (points aquired in time domain)

  • Edit offline (while VA running) of aquired time series: zoom, navigate

  • Saving of samples in TXT format

  • Clipboard for aquired samples

  • Print of aquired samples

  • D/A conversion: the points aquired may be converted using Nyquist theorem for full reconstruction of  signal in time domain (see point 8 for D/A in real time)

(8) – real time DIGITAL/ANALOG conversion

  • D/A in real time

  • Dual channel

  • Allows visualizing each aquired harmonic

Points (8) need a clairification:


VA has the unbeatable feature  to perform a full real time Digital-Analog conversion for the oscilloscope function.

Consider using a frequency sampling of (standard) 44100 Hz, with a 16 bit resolution (resolution is not relevant for the purpose of the discussion below…)

Other programs similar to VA simply plot the raw points on the screen, which means you can’t easily analyze signals with a frequency higher than 3000/5000 Hz (there are limited points to plot). Even worse, think a sinusoidal signal of 20 KHz. You would have only 2 points (more or less) per cycle! … The Nyquist theorem says that it is sufficient to RECONSTRUCT the original  signal…try to see what happens if you draw a sine with only two points …it will appear like a triangular waveform…

Try the power of VA enabling the function “full D/A”, apply a sinusoidal signal of 15-20 KHz (for example using the Waveform generator included in VA) finally use the “Time division” control for the selected channel (mS/d) to display the signal at the desired detail level. You will see a perfect waveform with all the points of the original signal (not only two).

(9) Frequency compensation

Visual Analyser allows you to apply a predefined frequency response to compensate (for instance) the frequency response  of a microphone. You should know the frequency response of your microphone; normally professional microphone should be shipped with the typical frequency response. You can add a limited number of points in VA, and apply. VA will interpolate a continues curve by means of cubic spline interpolation algorithm. You can do it through the windows below.


 Posted by at 1:14 pm
Apr 272020
 

Dr.CH.Ting:

“n FOR-NEXT runs n+1 loops by design”

Why and how to cope with:

https://github.com/TG9541/stm8ef/wiki/eForth-FOR-..-NEXT

eForth FOR .. NEXT

Thomas edited this page on Dec 26, 2018 · 1 revision

Discussion of eForth FOR .. NEXT

While it’s advisable to use the STM8 eForth DO .. LEAVE .. LOOP/+LOOP structure instead of FOR .. NEXT and its variants, the following discussion deals with the most main properties, idioms and limitations of the this “eForth-ism”.

Basic properties of eForth FOR .. NEXT

Among “small Forth implemenations” the eForth FOR .. NEXT construct is idiosyncratic, and some of its properties and idioms are rather difficult to understand.

Here is a the basic FOR .. NEXT loop:

: test-for
   FOR I . NEXT ;

NEXT decrements the loop counter on the return stack (accessible with I or R@) and loops while the counter is positive. 4 test-for prints 4 3 2 1 00 test-for prints 0, and -1 test-for prints -1.

The following FOR .. NEXT properties are noteworthy:

  • at least one iteration, with the loop counter equal to the input to FOR will be performed
  • the nuber of iterations is limited to 32768, and
  • the loop count will be “one-too-many” compared to standard loop structures (e.g. DO .. LOOP)

eForth FOR .. AFT .. THEN .. NEXT

The most unusual feature eForth provides is the word AFT:

: test-aft1 ( n -- )
   FOR
      \ first loop
      ."  for"
      AFT
         \ following iterations
         ."  aft"
      THEN
      \ all iterations
      I .
   NEXT ;

2 test-aft1 prints for 2 aft 1 aft 0. Why one would need such a control structure is all but obvious. The eForth core implementation use of AFT, however, shows that it not only works around the “one-too-many” iterations in FOR .. NEXT, but it also provides loop count testing if the actual “loop clause code” is in the AFT .. THEN block:

: test-aft2 ( n -- )
    FOR AFT
       I .
    THEN NEXT ;

Running 3 test-aft2 prints 2 1 0, and 0 test-aft2 or -1 test-aft2 print nothing at all. This structure is widely used in the eForth core, e.g. in CMOVESAME? and TYPE. The effect is that input testing around FOR .. NEXT, especially for 0 counts, isn’t needed.

eForth FOR .. WHILE .. NEXT .. ELSE .. THEN

A loop structure similar to DO .. LEAVE .. LOOP can be implemented in “pure eForth” with an idiomatic combination of FOR .. NEXTWHILE, and ELSE .. THEN:

: test-for-while ( n1 n2 -- )
   FOR
      DUP I = NOT WHILE
      I . \ limit not reached
   NEXT
      ."  end"
   ELSE
      ."  limit"
      R> DROP \ remove the FOR loop counter
   THEN
   DROP ;   \ drop limit

In this example, 5 10 test-for-while prints 10 9 8 5 6 limit, and 5 4 test-for-while prints 4 3 2 1 0 end.

WHILE puts a the address of its conditional branch target on the stack above the start address of FOR the for loop (which is used when compiling NEXT). During compilation, ELSE then uses this address to make WHILE exit to the code block delimited by THEN. Note that the ELSE clause is responsible of removing the loop counter from the return stack.

Note that the FOR .. WHILE .. NEXT .. ELSE .. THEN idiom can’t be mixed with the FOR .. AFT .. THEN .. NEXT idiom!

 Posted by at 7:22 am
Apr 052020
 

 

https://skilldrick.github.io/easyforth/

 

Easy Forth

by Nick Morgan

View on GitHub

Introduction

This small ebook is here to teach you a programming language called Forth. Forth is a language unlike most others. It’s not functional or object oriented, it doesn’t have type-checking, and it basically has zero syntax. It was written in the 70s, but is still used today for certain applications.

Why would you want to learn such an odd language? Every new programming language you learn helps you think about problems in new ways. Forth is very easy to learn, but it requires you to think in a different way than you’re used to. That makes it a perfect language to broaden your coding horizons.

This book includes a simple implementation of Forth I wrote in JavaScript. It’s by no means perfect, and is missing a lot of the functionality you’d expect in a real Forth system. It’s just here to give you an easy way to try out the examples. (If you’re a Forth expert, please contribute here and make it better!)

I’m going to assume that you know at least one other programming language, and have a basic idea of how stacks work as a data structure.

Adding Some Numbers

The thing that separates Forth from most other languages is its use of the stack. In Forth, everything revolves around the stack. Any time you type a number, it gets pushed onto the stack. If you want to add two numbers together, typing + takes the top two numbers off the stack, adds them, and puts the result back on the stack.

Let’s take a look at an example. Type (don’t copy-paste) the following into the interpreter, typing Enter after each line.

1
2
3
<- Top

Every time you type a line followed by the Enter key, the Forth interpreter executes that line, and appends the string ok to let you know there were no errors. You should also notice that as you execute each line, the area at the top fills up with numbers. That area is our visualization of the stack. It should look like this:

1 2 3 <- Top

Now, into the same interpreter, type a single + followed by the Enter key. The top two elements on the stack, 2 and 3, have been replaced by 5.

1 5 <- Top

At this point, your editor window should look like this:

1 ok 2 ok 3 ok + ok

Type + again and press Enter, and the top two elements will be replaced by 6. If you type + one more time, Forth will try to pop the top two elements off the stack, even though there’s only one element on the stack! This results in a Stack underflow error:

1 ok 2 ok 3 ok + ok + ok + Stack underflow

Forth doesn’t force you to type every token as a separate line. Type the following into the next editor, followed by the Enter key:

123 456 +
<- Top

The stack should now look like this:

579 <- Top

This style, where the operator appears after the operands, is known as Reverse-Polish notation. Let’s try something a bit more complicated, and calculate 10 * (5 + 2). Type the following into the interpreter:

5 2 + 10 *
<- Top

One of the nice things about Forth is that the order of operations is completely based on their order in the program. For example, when executing 5 2 + 10 *, the interpreter pushes 5 to the stack, then 2, then adds them and pushes the resulting 7, then pushes 10 to the stack, then multiplies 7 and 10. Because of this, there’s no need for parentheses to group operators with lower precedence.

Stack Effects

Most Forth words affect the stack in some way. Some take values off the stack, some leave new values on the stack, and some do a mixture of both. These “stack effects” are commonly represented using comments of the form ( before -- after ). For example, + is ( n1 n2 -- sum ) – n1 and n2 are the top two numbers on the stack, and sum is the value left on the stack.

Defining Words

The syntax of Forth is extremely straightforward. Forth code is interpreted as a series of space-delimited words. Almost all non-whitespace characters are valid in words. When the Forth interpreter reads a word, it checks to see if a definition exists in an internal structure known as the Dictionary. If it is found, that definition is executed. Otherwise, the word is assumed to be a number, and it is pushed onto the stack. If the word cannot be converted to a number, an error occurs.

You can try that out yourself below. Type foo (an unrecognized word) and press enter.

<- Top

You should see something like this:

foo foo ?

foo ? means that Forth was unable to find a definition for foo, and it wasn’t a valid number.

We can create our own definition of foo using two special words called : (colon) and ; (semicolon). : is our way of telling Forth we want to create a definition. The first word after the : becomes the definition name, and the rest of the words (until the ;) make up the body of the definition. It’s conventional to include two spaces between the name and the body of the definition. Try entering the following:

: foo  100 + ;
1000 foo
foo foo foo

Warning: A common mistake is to miss out the space before the ; word. Because Forth words are space delimited and can contain most characters, +; is a perfectly valid word and is not parsed as two separate words.

<- Top

As you’ve hopefully figured out, our foo word simply adds 100 to the value on top of the stack. It’s not very interesting, but it should give you an idea of how simple definitions work.

Stack Manipulation

Now we can start taking a look at some of Forth’s predefined words. First, let’s look at some words for manipulating the elements at the top of the stack.

dup ( n -- n n )

dup is short for “duplicate” – it duplicates the top element of the stack. For example, try this out:

1 2 3 dup
<- Top

You should end up with the following stack:

1 2 3 3 <- Top

drop ( n -- )

drop simply drops the top element of the stack. Running:

1 2 3 drop

gives you a stack of:

1 2 <- Top
<- Top

swap ( n1 n2 -- n2 n1 )

swap, as you may have guessed, swaps the top two elements of the stack. For example:

1 2 3 4 swap

will give you:

1 2 4 3 <- Top
<- Top

over ( n1 n2 -- n1 n2 n1 )

over is a bit less obvious: it takes the second element from the top of the stack and duplicates it to the top of the stack. Running this:

1 2 3 over

will result in this:

1 2 3 2 <- Top
<- Top

rot ( n1 n2 n3 -- n2 n3 n1 )

Finally, rot “rotates” the top three elements of the stack. The third element from the top of the stack gets moved to the top of the stack, pushing the other two elements down.

1 2 3 rot

gives you:

2 3 1 <- Top
<- Top

Generating Output

Next, let’s look at some words for outputting text to the console.

. ( n -- ) (period)

The simplest output word in Forth is .. You can use . to output the top of the stack in the output of the current line. For example, try running this (make sure to include all the spaces!):

1 . 2 . 3 . 4 5 6 . . .
<- Top

You should see this:

1 . 2 . 3 . 4 5 6 . . . 1 2 3 6 5 4 ok

Going through this in order, we push 1, then pop it off and output it. Then we do the same with 2 and 3. Next we push 45, and 6 onto the stack. We then pop them off and output them one-by-one. That’s why the last three numbers in the output are reversed: the stack is last in, first out.

emit ( c -- )

emit can be used to output numbers as ascii characters. Just like . outputs the number at the top of the stack, emit outputs that number as an ascii character. For example:

 33 119 111 87 emit emit emit emit
<- Top

I won’t give the output here so as to not ruin the surprise. This could also be written as:

87 emit 111 emit 119 emit 33 emit

Unlike .emit doesn’t output any space after each character, enabling you to build up arbitrary strings of output.

cr ( -- )

cr is short for carriage return – it simply outputs a newline:

cr 100 . cr 200 . cr 300 .
<- Top

This will output:

cr 100 . cr 200 . cr 300 . 100 200 300 ok

." ( -- )

Finally we have ." – a special word for outputting strings. The ." word works differently inside definitions to interactive mode. ." marks the beginning of a string to output, and the end of the string is marked by ". The closing " isn’t a word, and so doesn’t need to be space-delimited. Here’s an example:

: say-hello  ." Hello there!" ;
say-hello
<- Top

You should see the following output

say-hello Hello there! ok

We can combine .".cr, and emit to build up more complex output:

: print-stack-top  cr dup ." The top of the stack is " .
  cr ." which looks like '" dup emit ." ' in ascii  " ;
48 print-stack-top
<- Top

Running this should give you the following output:

48 print-stack-top The top of the stack is 48 which looks like ‘0’ in ascii ok

Conditionals and Loops

Now onto the fun stuff! Forth, like most other languages, has conditionals and loops for controlling the flow of your program. To understand how they work, however, first we need to understand booleans in Forth.

Booleans

There’s actually no boolean type in Forth. The number 0 is treated as false, and any other number is true, although the canonical true value is -1 (all boolean operators return 0 or -1).

To test if two numbers are equal, you can use =:

3 4 = .
5 5 = .

This should output:

3 4 = . 0 ok 5 5 = . -1 ok
<- Top

You can use < and > for less than and greater than. < checks to see if the second item from the top of the stack is less than the top item of the stack, and vice versa for >:

3 4 < .
3 4 > .
3 4 < . -1 ok 3 4 > . 0 ok
<- Top

The boolean operators And, Or, and Not are available as andor, and invert:

3 4 < 20 30 < and .
3 4 < 20 30 > or .
3 4 < invert .

The first line is the equivalent of 3 < 4 & 20 < 30 in a C-based language. The second line is the equivalent of 3 < 4 | 20 > 30. The third line is the equivalent of !(3 < 4).

andor, and invert are all bitwise operations. For well-formed flags (0 and -1) they’ll work as expected, but they’ll give incorrect results for arbitrary numbers.

<- Top

if then

Now we can finally get onto conditionals. Conditionals in Forth can only be used inside definitions. The simplest conditional statement in Forth is if then, which is equivalent to a standard if statement in most languages. Here’s an example of a definition using if then. In this example, we’re also using the mod word, which returns the modulo of the top two numbers on the stack. In this case, the top number is 5, and the other is whatever was placed on the stack before calling buzz?. Therefore, 5 mod 0 = is a boolean expression that checks to see if the top of the stack is divisible by 5.

: buzz?  5 mod 0 = if ." Buzz" then ;
3 buzz?
4 buzz?
5 buzz?
<- Top

This will output:

3 buzz? ok 4 buzz? ok 5 buzz? Buzz ok

It’s important to note that the then word marks the end of the if statement. This makes it equivalent to fi in Bash or end in Ruby, for example.

Another important thing to realize is that if consumes the top value on the stack when it checks to see if it’s true or false.

if else then

if else then is equivalent to an if/else statement in most languages. Here’s an example of its use:

: is-it-zero?  0 = if ." Yes!" else ." No!" then ;
0 is-it-zero?
1 is-it-zero?
2 is-it-zero?
<- Top

This outputs:

0 is-it-zero? Yes! ok 1 is-it-zero? No! ok 2 is-it-zero? No! ok

This time, the if clause (consequent) is everything between if and else, and the else clause (alternative) is everything between else and then.

do loop

do loop in Forth most closely resembles a for loop in most C-based languages. In the body of a do loop, the special word i pushes the current loop index onto the stack.

The top two values on the stack give the starting value (inclusive) and ending value (exclusive) for the i value. The starting value is taken from the top of the stack. Here’s an example:

: loop-test  10 0 do i . loop ;
loop-test
<- Top

This should output:

loop-test 0 1 2 3 4 5 6 7 8 9 ok

The expression 10 0 do i . loop is roughly equivalent to:

for (int i = 0; i < 10; i++) {
  print(i);
}

Fizz Buzz

We can write the classic Fizz Buzz program easily using a do loop:

: fizz?  3 mod 0 = dup if ." Fizz" then ;
: buzz?  5 mod 0 = dup if ." Buzz" then ;
: fizz-buzz?  dup fizz? swap buzz? or invert ;
: do-fizz-buzz  25 1 do cr i fizz-buzz? if i . then loop ;
do-fizz-buzz
<- Top

fizz? checks to see if the top of the stack is divisible by 3 using 3 mod 0 =. It then uses dup to duplicate this result. The top copy of the value is consumed by if. The second copy is left on the stack and acts as the return value of fizz?.

If the number on top of the stack is divisible by 3, the string "Fizz" will be output, otherwise there will be no output.

buzz? does the same thing but with 5, and outputs the string "Buzz".

fizz-buzz? calls dup to duplicate the value on top of the stack, then calls fizz?, converting the top copy into a boolean. After this, the top of the stack consists of the original value, and the boolean returned by fizz?swap swaps these, so the original top-of-stack value is back on top, and the boolean is underneath. Next we call buzz?, which replaces the top-of-stack value with a boolean flag. Now the top two values on the stack are booleans representing whether the number was divisible by 3 or 5. After this, we call or to see if either of these is true, and invert to negate this value. Logically, the body of fizz-buzz? is equivalent to:

!(x % 3 == 0 || x % 5 == 0)

Therefore, fizz-buzz? returns a boolean indicating if the argument is not divisible by 3 or 5, and thus should be printed. Finally, do-fizz-buzz loops from 1 to 25, calling fizz-buzz? on i, and outputting i if fizz-buzz? returns true.

If you’re having trouble figuring out what’s going on inside fizz-buzz?, the example below might help you to understand how it works. All we’re doing here is executing each word of the definition of fizz-buzz? on a separate line. As you execute each line, watch the stack to see how it changes:

: fizz?  3 mod 0 = dup if ." Fizz" then ;
: buzz?  5 mod 0 = dup if ." Buzz" then ;
4
dup
fizz?
swap
buzz?
or
invert
<- Top

Here’s how each line affects the stack:

4         4 <- Top
dup       4 4 <- Top
fizz?     4 0 <- Top
swap      0 4 <- Top
buzz?     0 0 <- Top
or        0 <- Top
invert    -1 <- Top

Remember, the final value on the stack is the return value of the fizz-buzz? word. In this case, it’s true, because the number was not divisible by 3 or 5, and so should be printed.

Here’s the same thing but starting with 5:

5         5 <- Top
dup       5 5 <- Top
fizz?     5 0 <- Top
swap      0 5 <- Top
buzz?     0 -1 <- Top
or        -1 <- Top
invert    0 <- Top

In this case the original top-of-stack value was divisible by 5, so nothing should be printed.

Variables and Constants

Forth also allows you to save values in variables and constants. Variables allow you to keep track of changing values without having to store them on the stack. Constants give you a simple way to refer to a value that won’t change.

Variables

Because the role of local variables is generally played by the stack, variables in Forth are used more to store state that may be needed across multiple words.

Defining variables is simple:

variable balance

This basically associates a particular memory location with the name balancebalance is now a word, and all it does is to push its memory location onto the stack:

variable balance
balance
<- Top

You should see the value 1000 on the stack. This Forth implementation arbitrarily starts storing variables at the memory location 1000.

The word ! stores a value at the memory location referenced by a variable, and the word @ fetches the value from a memory location:

variable balance
123 balance !
balance @
<- Top

This time you should see the value 123 on the stack. 123 balance pushes the value and the memory location onto the stack, and ! stores that value at that memory location. Likewise, @ retrieves the value based on the memory location, and pushes that value onto the stack. If you’ve used C or C++, you can think of balance as a pointer that is dereferenced by @.

The word ? is defined as @ . and it prints the current value of a variable. The word +! is used to increase the value of a variable by a certain amount (like += in C-based languages).

variable balance
123 balance !
balance ?
50 balance +!
balance ?
<- Top

Run this code and you should see:

variable balance ok 123 balance ! ok balance ? 123 ok 50 balance +! ok balance ? 173 ok

Constants

If you have a value that doesn’t change, you can store it as a constant. Constants are defined in one line, like this:

42 constant answer

This creates a new constant called answer with the value 42. Unlike variables, constants just represent values, rather than memory locations, so there’s no need to use @.

42 constant answer
2 answer *
<- Top

Running this will push the value 84 on the stack. answer is treated as if it was the number it represents (just like constants and variables in other languages).

Arrays

Forth doesn’t exactly support arrays, but it does allow you to allocate a zone of contiguous memory, a lot like arrays in C. To allocate this memory, use the allot word.

variable numbers
3 cells allot
10 numbers 0 cells + !
20 numbers 1 cells + !
30 numbers 2 cells + !
40 numbers 3 cells + !
<- Top

This example creates a memory location called numbers, and reserves three extra memory cells after this location, giving a total of four memory cells. (cells just multiplies by the cell-width, which is 1 in this implementation.)

numbers 0 + gives the address of the first cell in the array. 10 numbers 0 + ! stores the value 10 in the first cell of the array.

We can easily write words to simplify array access:

variable numbers
3 cells allot
: number  ( offset -- addr )  cells numbers + ;

10 0 number !
20 1 number !
30 2 number !
40 3 number !

2 number ?
<- Top

number takes an offset into numbers and returns the memory address at that offset. 30 2 number ! stores 30 at offset 2 in numbers, and 2 number ? prints the value at offset 2 in numbers.

Keyboard Input

Forth has a special word called key, which is used for accepting keyboard input. When the key word is executed, execution is paused until a key is pressed. Once a key is pressed, the key code of that key is pushed onto the stack. Try out the following:

key . key . key .
<- Top

When you run this line, you’ll notice that at first nothing happens. This is because the interpreter is waiting for your keyboard input. Try hitting the A key, and you should see the keycode for that key, 65, appear as output on the current line. Now hit B, then C, and you should see the following:

key . key . key . 65 66 67 ok

Printing keys with begin until

Forth has another kind of loop called begin until. This works like a while loop in C-based languages. Every time the word until is hit, the interpreter checks to see if the top of the stack is non-zero (true). If it is, it jumps back to the matching begin. If not, execution continues.

Here’s an example of using begin until to print key codes:

: print-keycode  begin key dup . 32 = until ;
print-keycode
<- Top

This will keep printing key codes until you press space. You should see something like this:

print-keycode 80 82 73 78 84 189 75 69 89 67 79 68 69 32 ok

key waits for key input, then dup duplicates the keycode from key. We then use . to output the top copy of the keycode, and 32 = to check to see if the keycode is equal to 32. If it is, we break out of the loop, otherwise we loop back to begin.

Snake!

Now it’s time to put it all together and make a game! Rather than having you type all the code, I’ve pre-loaded it into the editor.

Before we look at the code, try playing the game. To start the game, execute the word start. Then use the arrow keys to move the snake. If you lose, you can run start again.

<- Top

variable snake-x-head ok

500 cells allot ok

ok

variable snake-y-head ok

500 cells allot ok

ok

variable apple-x ok

variable apple-y ok

ok

0 constant left ok

1 constant up ok

2 constant right ok

3 constant down ok

ok

24 constant width ok

24 constant height ok

ok

variable direction ok

variable length ok

ok

: snake-x ( offset — address )

cells snake-x-head + ; ok

ok

: snake-y ( offset — address )

cells snake-y-head + ; ok

ok

: convert-x-y ( x y — offset ) 24 cells * + ; ok

: draw ( color x y — ) convert-x-y graphics + ! ; ok

: draw-white ( x y — ) 1 rot rot draw ; ok

: draw-black ( x y — ) 0 rot rot draw ; ok

ok

: draw-walls

width 0 do

i 0 draw-black

i height 1 – draw-black

loop

height 0 do

0 i draw-black

width 1 – i draw-black

loop ; ok

ok

: initialize-snake

4 length !

length @ 1 + 0 do

12 i – i snake-x !

12 i snake-y !

loop

right direction ! ; ok

ok

: set-apple-position apple-x ! apple-y ! ; ok

ok

: initialize-apple 4 4 set-apple-position ; ok

ok

: initialize

width 0 do

height 0 do

j i draw-white

loop

loop

draw-walls

initialize-snake

initialize-apple ; ok

ok

: move-up -1 snake-y-head +! ; ok

: move-left -1 snake-x-head +! ; ok

: move-down 1 snake-y-head +! ; ok

: move-right 1 snake-x-head +! ; ok

ok

: move-snake-head direction @

left over = if move-left else

up over = if move-up else

right over = if move-right else

down over = if move-down

then then then then drop ; ok

ok

\ Move each segment of the snake forward by one ok

: move-snake-tail 0 length @ do

i snake-x @ i 1 + snake-x !

i snake-y @ i 1 + snake-y !

-1 +loop ; ok

ok

: is-horizontal direction @ dup

left = swap

right = or ; ok

ok

: is-vertical direction @ dup

up = swap

down = or ; ok

ok

: turn-up is-horizontal if up direction ! then ; ok

: turn-left is-vertical if left direction ! then ; ok

: turn-down is-horizontal if down direction ! then ; ok

: turn-right is-vertical if right direction ! then ; ok

ok

: change-direction ( key — )

37 over = if turn-left else

38 over = if turn-up else

39 over = if turn-right else

40 over = if turn-down

then then then then drop ; ok

ok

: check-input

last-key @ change-direction

0 last-key ! ; ok

ok

\ get random x or y position within playable area ok

: random-position ( — pos )

width 4 – random 2 + ; ok

ok

: move-apple

apple-x @ apple-y @ draw-white

random-position random-position

set-apple-position ; ok

ok

: grow-snake 1 length +! ; ok

ok

: check-apple

snake-x-head @ apple-x @ =

snake-y-head @ apple-y @ =

and if

move-apple

grow-snake

then ; ok

ok

: check-collision ( — flag )

\ get current x/y position

snake-x-head @ snake-y-head @

\ get color at current position

convert-x-y graphics + @

\ leave boolean flag on stack

0 = ; ok

ok

: draw-snake

length @ 0 do

i snake-x @ i snake-y @ draw-black

loop

length @ snake-x @

length @ snake-y @

draw-white ; ok

ok

: draw-apple

apple-x @ apple-y @ draw-black ; ok

ok

ok

: game-loop ( — )

begin

draw-snake

draw-apple

100 sleep

check-input

move-snake-tail

move-snake-head

check-apple

check-collision

until

.” Game Over” ; ok

ok

: start initialize game-loop ; ok

ok

Before we delve too deeply into this code, two disclaimers. First, this is terrible Forth code. I’m by no means a Forth expert, so there’s probably all kinds of things I’m doing in completely the wrong way. Second, this game uses a few non-standard techniques in order to interface with JavaScript. I’ll go through these now.

Non-Standard Additions

The Canvas

You may have noticed that this editor is different from the others: it has an HTML5 Canvas element built in. I’ve created a very simple memory-mapped interface for drawing onto this canvas. The canvas is split up into 24 x 24 “pixels” which can be black or white. The first pixel is found at the memory address given by the variable graphics, and the rest of the pixels are offsets from the variable. So, for example, to draw a white pixel in the top-left corner you could run

1 graphics !
<- Top

The game uses the following words to draw to the canvas:

: convert-x-y ( x y -- offset )  24 cells * + ;
: draw ( color x y -- )  convert-x-y graphics + ! ;
: draw-white ( x y -- )  1 rot rot draw ;
: draw-black ( x y -- )  0 rot rot draw ;

For example, 3 4 draw-white draws a white pixel at the coordinates (3, 4). The y coordinate is multiplied by 24 to get the row, then the x coordinated is added to get the column.

Non-Blocking Keyboard Input

The Forth word key blocks, so is unsuitable for a game like this. I’ve added a variable called last-key which always holds the value of the last key to be pressed. last-key is only updated while the interpreter is running Forth code.

Random Number Generation

The Forth standard doesn’t define a way of generating random numbers, so I’ve added a word called random ( range -- n ) that takes a range and returns a random number from 0 to range – 1. For example, 3 random could return 01, or 2.

sleep ( ms -- )

Finally, I’ve added a blocking sleep word that pauses execution for the number of milliseconds given.

The Game Code

Now we can work through the code from start to finish.

Variables and Constants

The start of the code just sets up some variables and constants:

variable snake-x-head
500 cells allot

variable snake-y-head
500 cells allot

variable apple-x
variable apple-y

0 constant left
1 constant up
2 constant right
3 constant down

24 constant width
24 constant height

variable direction
variable length

snake-x-head and snake-y-head are memory locations used to store the x and y coordinates of the head of the snake. 500 cells of memory are alloted after these two locations to store the coordinates of the tail of the snake.

Next we define two words for accessing memory locations representing the body of the snake.

: snake-x ( offset -- address )
  cells snake-x-head + ;

: snake-y ( offset -- address )
  cells snake-y-head + ;

Just like the number word earlier, these two words are used to access elements in the arrays of snake segments. After this come some words for drawing to the canvas, described above.

We use constants to refer to the four directions (leftupright, and down), and a variable direction to store the current direction.

Initialization

After this we initialize everything:

: draw-walls
  width 0 do
    i 0 draw-black
    i height 1 - draw-black
  loop
  height 0 do
    0 i draw-black
    width 1 - i draw-black
  loop ;

: initialize-snake
  4 length !
  length @ 1 + 0 do
    12 i - i snake-x !
    12 i snake-y !
  loop
  right direction ! ;

: set-apple-position apple-x ! apple-y ! ;

: initialize-apple  4 4 set-apple-position ;

: initialize
  width 0 do
    height 0 do
      j i draw-white
    loop
  loop
  draw-walls
  initialize-snake
  initialize-apple ;

draw-walls uses two do/loops to draw the horizontal and vertical walls, respectively.

initialize-snake sets the length variable to 4, then loops from 0 to length + 1 filling in the starting snake positions. The snake positions are always kept one longer than the length so we can grow the snake easily.

set-apple-position and initialize-apple set the initial position of the apple to (4,4).

Finally, initialize fills everything in white and calls the three initialization words.

Moving the Snake

Here’s the code for moving the snake based on the current value of direction:

: move-up  -1 snake-y-head +! ;
: move-left  -1 snake-x-head +! ;
: move-down  1 snake-y-head +! ;
: move-right  1 snake-x-head +! ;

: move-snake-head  direction @
  left over  = if move-left else
  up over    = if move-up else
  right over = if move-right else
  down over  = if move-down
  then then then then drop ;

\ Move each segment of the snake forward by one
: move-snake-tail  0 length @ do
    i snake-x @ i 1 + snake-x !
    i snake-y @ i 1 + snake-y !
  -1 +loop ;

move-upmove-leftmove-down, and move-right just add or subtract one from the x or y coordinate of the snake head. move-snake-head inspects the value of direction and calls the appropriate move-* word. This over = if pattern is an idiomatic way of doing case statements in Forth.

move-snake-tail goes through the array of snake positions backwards, copying each value forward by 1 cell. This is called before we move the snake head, to move each segment of the snake forward one space. It uses a do/+loop, a variation of a do/loop that pops the stack on every iteration and adds that value to the next index, instead of incrementing by 1 each time. So 0 length @ do -1 +loop loops from length to 0 in increments of -1.

Keyboard Input

The next section of code takes the keyboard input and changes the snake direction if appropriate.

: is-horizontal  direction @ dup
  left = swap
  right = or ;

: is-vertical  direction @ dup
  up = swap
  down = or ;

: turn-up     is-horizontal if up direction ! then ;
: turn-left   is-vertical if left direction ! then ;
: turn-down   is-horizontal if down direction ! then ;
: turn-right  is-vertical if right direction ! then ;

: change-direction ( key -- )
  37 over = if turn-left else
  38 over = if turn-up else
  39 over = if turn-right else
  40 over = if turn-down
  then then then then drop ;

: check-input
  last-key @ change-direction
  0 last-key ! ;

is-horizontal and is-vertical check the current status of the direction variable to see if it’s a horizontal or vertical direction.

The turn-* words are used to set a new direction, but use is-horizontal and is-vertical to check the current direction first to see if the new direction is valid. For example, if the snake is moving horizontally, setting a new direction of left or right doesn’t make sense.

change-direction takes a key and calls the appropriate turn-* word if the key was one of the arrow keys. check-input does the work of getting the last key from the last-key pseudo-variable, calling change-direction, then setting last-key to 0 to indicate that the most recent keypress has been dealt with.

The Apple

The next code is used for checking to see if the apple has been eaten, and if so, moving it to a new (random) location. Also, if the apple has been eaten we grow the snake.

\ get random x or y position within playable area
: random-position ( -- pos )
  width 4 - random 2 + ;

: move-apple
  apple-x @ apple-y @ draw-white
  random-position random-position
  set-apple-position ;

: grow-snake  1 length +! ;

: check-apple ( -- flag )
  snake-x-head @ apple-x @ =
  snake-y-head @ apple-y @ =
  and if
    move-apple
    grow-snake
  then ;

random-position generates a random x or y coordinate in the range of 2 to width - 2. This prevents the apple from ever appearing right next to the wall.

move-apple erases the current apple (using draw-white) then creates a new pair of x/y coordinates for the apple using random-position twice. Finally, it calls set-apple-position to move the apple to the new coordinates.

grow-snake simply adds one to the length variable.

check-apple compares the x/y coordinates of the apple and the snake head to see if they’re the same (using = twice and and to combine the two booleans). If the coordinates are the same, we call move-apple to move the apple to a new position and grow-snake to make the snake 1 segment longer.

Collision Detection

Next we see if the snake has collided with the walls or itself.

: check-collision ( -- flag )
  \ get current x/y position
  snake-x-head @ snake-y-head @

  \ get color at current position
  convert-x-y graphics + @

  \ leave boolean flag on stack
  0 = ;

check-collision checks to see if the new snake head position is already black (this word is called after updating the snake’s position but before drawing it at the new position). We leave a boolean on the stack to say whether a collision has occured or not.

Drawing the Snake and Apple

The next two words are responsible for drawing the snake and apple.

: draw-snake
  length @ 0 do
    i snake-x @ i snake-y @ draw-black
  loop
  length @ snake-x @
  length @ snake-y @
  draw-white ;

: draw-apple
  apple-x @ apple-y @ draw-black ;

draw-snake loops through each cell in the snake arrays, drawing a black pixel for each one. After that it draws a white pixel at an offset of length. The last part of the tail is at length - 1 into the array so length holds the previous last tail segment.

draw-apple simply draws a black pixel at the apple’s current location.

The Game Loop

The game loop constantly loops until a collision occurs, calling each of the words defined above in turn.

: game-loop ( -- )
  begin
    draw-snake
    draw-apple
    100 sleep
    check-input
    move-snake-tail
    move-snake-head
    check-apple
    check-collision
  until
  ." Game Over" ;

: start  initialize game-loop ;

The begin/until loop uses the boolean returned by check-collision to see whether to continue looping or to exit the loop. When the loop is exited the string "Game Over" is printed. We use 100 sleep to pause for 100 ms every iteration, making the game run at rougly 10 fps.

start just calls initialize to reset everything, then kicks off game-loop. Because all the initialization happens in the initialize word, you can call start again after game over.


And that’s it! Hopefully all the code in the game made sense. If not, you can try running individual words to see their effect on the stack and/or on the variables.

The End

Forth is actually much more powerful than what I’ve taught here (and what I implemented in my interpreter). A true Forth system allows you to modify how the compiler works and create new defining words, allowing you to completely customize your environment and create your own languages within Forth.

A great resource for learning the full power of Forth is the short book “Starting Forth” by Leo Brodie. It’s available for free online and teaches you all the fun stuff I left out. It also has a good set of exercises for you to test out your knowledge. You’ll need to download a copy of SwiftForth to run the code though.

 Posted by at 6:11 am
Apr 022020
 

https://udamonic.com/accessing-memory.html

 

 Posted by at 7:37 am
Apr 022020
 

https://sites.google.com/view/forth-books/home/forth-books/dr-tings-collection14

 

FORTH BOOKS 14

DR.TINGS COLLECTION OF OFFETE

original link

http://forth.org/OffeteStore/OffeteStore.html?fbclid=IwAR2qzzV_12rhZL10lnXPa1uqDu5_ygrgWifh2b20Zbqi61AmPXj_BUBEn7Y

Here is a list of pdf document files and zipped software items from Offete Store which are now available for download. Please contact the author, CH Ting, if you have any questions about this material.

Inside Forth – Fourth Edition – 2013 – pdf

Systems Guide to figForth – Third Edition – 2013 – pdf

eForth and Zen – Second Edition – 2013 – pdf

Footsteps in an Empty Valley – NC4000 Single Chip Forth Engine – Third Expanded Edition – 1988 – pdf

Footsteps in an Empty Valley – NC4000 Single Chip Forth Engine – Fourth Edition – 2017 – pdf

F# – 241 – zip

ADUC Compiler – 520 – zip

eForth for SAM7 Chip – 2008 – zip

cEF, eForth in C, Version 1.1 – 2009 – zip

cEF, eForth in C – 2009 – zip

eForth for STM8S – 2010 – zip

eP32 Microcontroller Design in VHDL – 2012 – zip

328eForth for Arduino Uno – 2011– zip

eForth as an Arduino Sketch, Version 2.0 – 2011 – zip

eP16 Microcontroller Design in VHDL – 2012 – zip

430eForth for LaunchPad – 2012 – zip

STM32 eForth – 2014 – zip

Zen of LaunchPad – Version 4.3 – 2015 – zip

86eForth – Version 2.03 – 2016 – zip

ep8080 – 2006 – zip

PDP1 Design Workshop – 2016 – zip

86eForth – Version 5.2 – 2016 – zip

espForth for ESP8266 – zip

ceForth_23 – zip

esp32Forth Serial Monitor – zip

esp32Forth Web Browser – zip

esp32Forth Macro Assembler – zip

ceForth_33 Macro Assembler – zip

Many thanks to Dr. Ting for being one of the best authors and teachers of Forth ! and for his gesture setting all those important documents free available !

 Posted by at 7:28 am
Mar 312020
 

https://wepresent.wetransfer.com/story/arif-al-nomay-corrupted-files/

 

Unexpected stories about creativity
Told by WeTransfer

Arif Al Nomay I just want the world to know about us

When a power cut and a computer malfunction caused Yemeni photographer Arif Al Nomay to lose years of work, he anxiously hunted for anything that might still be there. To his surprise, a set of photos taken at a Summer Festival in his country’s capital had survived, but they had been altered, their colors skewed and the details hard to distinguish. Since the festival took place the year before Yemen descended into war, the series would become a symbol for the pieces of everyday life that were lost as a result.

Words by Alex Kahl.

In 2014 Arif Al Nomay traveled with his camera to a park called The Seventy in Sanaa, the capital city of his home country of Yemen. He had been hired to take photographs at an annual festival, a celebration of the heritage that characterizes many of the country’s different regions.

 Posted by at 1:02 pm
Mar 242020
 

https://www.mikrocontroller.net/articles/Entprellung

 

Welcome to the Mikrocontroller.net article collection. All articles here can be edited by everyone according to the wiki principle. To the main page of the article collection

Development

From the Mikrocontroller.net article collection, with contributions from various authors (see version history)

Problem Description

Mechanical live components such as switches and buttons tend to bounce when switched on and off , ie they quickly switch off and on several times, which is caused by mechanical vibrations of the switch contact, unless they are protected against it with complex mechanical measures. The encoders in particular are sensitive to this due to the detent positions and the movement of the operator. Optoelectronic components and chemical contact switches as well as liquid switches also have the problem.

Simply put, a voltage switched by a bouncing switch or button looks like this: Entprellen.png

There are therefore several short switch-on pulses, which can be interpreted as multiple commands for push buttons and as wrong angular movements for rotary encoders. With switches, on the other hand, there are several resets and switch-on processes in the electronic assembly, which draw power unnecessarily or, in the worst case, stress or damage the circuit. Important switches and those that are supposed to carry high currents are protected by suitable measures such as redundancy, tap changer concepts or, in the case of gas and liquid switches, by electrochemical measures. This is saved with simple switches.

Since there is no safe way to avoid these effects with these simple, unprotected switches, the wrong signal must be evaluated sensibly by the electronics. There are different approaches for this:

Hardwareentprellung

Bounce-free switches

As already indicated, the electromechanical industry has various special constructions for special applications that generate clean switching states to the outside by using either mechanical damping in the form of a self-locking spring mechanism or an integrated electronic signal delay. However, such systems are expensive and are mostly used only in the performance range. In addition, they are not 100% safe and fail due to aging. Wherever possible, further measures are therefore taken to suppress bouncing.

Changeover switch

A classic RS flip-flop can be used to debounce toggle switches . In this variant, in addition to two NAND gates, only two pull-up resistors are required.

Debounce buttons with NAND-RS flip-flop

In the switch position shown, level 0 is present at position / S. This sets the flip-flop and the output at level 1. If the switch between contacts 2 and 3 closes, level 0 is present at position / R. This means that the output of the flip-flop goes to level 0. As soon as the switch changes from one contact to the other, it usually begins to bounce. During the bouncing, the switch switches between the two states “switch touches contact” and “switch is free in the air”. The output of the flip-flop remains stable during this bounce time, since the switch never touches the opposite contact during the bounce and the RS flip-flop can keep its state alone. The bounce time is strongly dependent on the switch type and is between 0.1 and 10ms. The dimensioning of the resistors is relatively uncritical. 100kOhm can be used as a guideline.

Toggle switch without flip-flop

If you don’t have a flip-flop at hand, you can also use this circuit.

Changer debounce with capacitor

How it works: When switching, the capacitor is always immediately recharged. While the contact bounces, it is in the air and has no connection. During this time, the capacitor maintains the level.

Dimensioning: If the debounced button is connected to an IC, the input leakage current is the decisive current. If further currents flow, these must be taken into account. With a microcontroller from Atmel, 1µA is typical. The following applies:

dUdt=IC

Since a bruise lasts about 10ms and the voltage should drop by a maximum of 0.5V during this time, the following capacity is reached:

C=IdtdU=1μA10ms0,5V20 F

A resistor can be added to reduce current peaks. A time constant of 1µs to 1ms seems reasonable. So 500 Ohm to 500kOhm can be used, whereby the current peaks are higher at low resistance, and the pin current becomes disruptive at 500kOhm.

Simple button

Even if the RS flip-flop is very effective, this variant of the debouncing is rarely used. The reason for this is that simple switches are used more often in circuits. These are often smaller and cheaper. To debounce simple push buttons / momentary switch, a simple RC low pass can be used. A capacitor is charged or discharged via a resistor depending on the switch position. The RC element forms a low pass, so that the voltage across the capacitor cannot jump from one level to the other.

Debounce buttons with RC debouncer

Emerging voltage curve


When the switch is open, the capacitor slowly charges to V cc through the two resistors R 1 and R 2 . When the switchover threshold is reached, the output jumps to level 0. If the switch is closed, the capacitor slowly discharges through resistor R 2 . Accordingly, the output of the inverter changes to level 1. While the button is bouncing, the voltage across the capacitor cannot change abruptly, since the charging and discharging takes place rather slowly via the resistors. In addition, the switching thresholds for the transition LOW-> HIGH and HIGH-> LOW are very different (hysteresis, see article Schmitt trigger). If the components are dimensioned correctly, the output of the inverter is thus free of bounce.

Please note that the inverter must be one with Schmitt trigger inputs, because the output is not defined for standard logic inputs in the range of typically 0.8V – 2.0V. For example, the 74HC14 or CD40106 (pin compatible) can be used as an inverter. Alternatively, a CD4093 can be used. The CD4093 is a NAND gate with Schmitt trigger inputs. To make an inverter out of a NAND gate, simply connect the two inputs or set one input to HIGH.

For a suitable dimensioning you have to juggle something with the standard formulas for a capacitor. The voltage across the capacitor during discharge is calculated according to:

UC(t)=U0etR2C1

For the output of the inverter to be stable, the voltage across the capacitor and thus the voltage at the input of the inverter must remain above the voltage at which the inverter switches. This threshold voltage is exactly the time-dependent voltage across the capacitor.

UC(t) Uth

By changing the formula:

R2=tC1⋅ UthU0)

A button usually bounces about 10ms. For safety reasons, a bounce time of 20ms can be assumed when calculating the resistance. U_0 is the operating voltage Vcc. The threshold voltage must be read from the data sheet of the Schmitt trigger used. The 74HC14 has a value of 2.0V. If you take 1µF for the capacitor and the operating voltage is 5V, the resistance is about 22kOhm.

If the switch is opened, the capacitor charges according to the following formula:

UC(t)=U0(1et(R1+R2)C1)

With U_th = U_C, the changeover to (R_1 + R_2) results in:

R1+R2=tC1⋅ ( 1 – UthU0)

A value of 2.3V can be read from the data sheet for the threshold voltage. With this value and the assumptions from above there is a value of 32kOhm for R_1 + R_2. This results in a value of approximately 10 kOhm for R_1.

Note: For Hitachi 74LS14 e.g. B. the upper and lower switching threshold values are different. Care must be taken that U_ {th} takes the lower threshold when unloading and U_ {th} takes the upper threshold when loading.

Softwareentprellung

In times of electronic evaluation of buttons and switches, debouncing software is often cheaper than using an expensive switch. For this reason, computer keyboards, for example, are no longer equipped with low-bounce keys or debounce capacitors.

If you use the microcontroller that is already available in most devices, for example, you can save yourself the additional hardware, since debouncing in software works practically just as well. It should only be noted that additional computing power and, depending on the implementation, some hardware resources (eg timers) are required. But you have the advantage of short pulses, which obviously can not be a key press but z. B. caused by stray, easy to filter.

Edge detection

There are 4 theoretical states for a push button:

  • 1. was not pressed and is not pressed
  • 2. was not pressed and is pressed (rising edge)
  • 3. was pressed and is still pressed
  • 4. was pressed and is no longer pressed (falling edge)

These individual states can now be easily queried / run through. The debouncing takes place through the entire duration of the program. The buttons are connected as active low to use the internal pull-ups.

This routine returns the value “1” for the “rising edge” state, otherwise “0”

#define TASTERPORT PINC
#define TASTERBIT PINC1

char taster(void)
{
    static unsigned char zustand;
    char rw = 0;

    if ( state  ==  0  &&  ! ( KEY PORT  &  ( 1 << KEYBIT )))    // key is pressed (rising edge) 
    { 
        state  =  1 ; 
        rw  =  1 ; 
    } 
    else  if  ( state  ==  1  &&  ! ( BUTTON PORT  &  ( 1 << BUTTON BIT )))    // button is held 
    { 
         state  =  2 ; 
         rw  =  0; 
    } 
    else  if  ( state  ==  2  &&  ( KEY PORT  &  ( 1 << KEYBIT )))    // 
    key is released (falling edge) { 
        state  =  3 ; 
        rw  =  0 ; 
    } 
    else  if  ( state  ==  3  &&  ( BUTTON PORT  &  ( 1 << BUTTON BIT )))    // button released 
    { 
        state  =  0 ; 
        rw  = 0;
    }

    return rw;
}

An extension so that a button is recognized for as long as required can be implemented very simply as follows:

    // state can either be detected as held for the first time or every other time 
    else  if  ((( state  ==  1 )  ||  ( state  ==  2 ))  &&  ! ( TASTERPORT  &  ( 1 << TASTERBIT )))    / / Button is held 
    { 
         state  =  2 ; 
         rw  =  0 ; 
    }

On hold procedure

If a microcontroller is to be used to count how often a contact or a relay is switched, the bouncing of the contact must be taken into account precisely – and differentiated from a desired multiple switching, as otherwise incorrect impulses may be counted or real switching processes may be skipped. This must be taken into account when writing the program with regard to scanning the contact.

In the following simple example of a debouncing, it should be noted that the AVR waits 200ms when a button is pressed, i.e. lies idle. A different method should be used for time-critical applications (e.g. querying the key states in a timer interrupt service routine).

#include <avr/io.h>
#include <inttypes.h>
#ifndef F_CPU 
#warning "F_CPU was not yet defined, is now defined with 3686400" 
#define F_CPU 3686400UL      / * quartz with 3.6864 Mhz * /
#endif
#include <util/delay.h>     /* bei alter avr-libc: #include <avr/delay.h> */      

/ * Simple function for debouncing a button * / 
inline  uint8_t  debounce ( volatile  uint8_t  * port ,  uint8_t  pin ) 
{ 
    if  (  ! ( * Port  &  ( 1  <<  pin ))  ) 
    { 
        / * pin was pulled to ground, wait 100ms * / 
        _delay_ms ( 50 );    // maximum value of the parameter at _delay_ms 
        _delay_ms ( 50 );    // note, cf. Documentation of the avr-libc 
        if  (  * port &  ( 1  <<  pin )  ) 
        { 
            / * Give user time to release the button * / 
            _delay_ms ( 50 ); 
            _delay_ms ( 50 );  
            return  1 ; 
        } 
    } 
    return  0 ; 
}

int  main ( void ) 
{ 
    DDRB  & =  ~ (  1  <<  PB0  );         / * PIN PB0 on input push button) * / 
    PORTB  | =  (  1  <<  PB0  );         / * Activate pull-up resistor * / 
    ... 
    if  ( debounce ( & PINB ,  PB0 )) 
    { 
        / * If button on PIN PB0 is pressed * / 
        / * Switch LED on or off at port PD7: * / 
        PORTD  =  PORTD  ^  (  1  <<  PD7  ); 
    }
    ...
}

Unfortunately, the above routine has several disadvantages:

  • it only detects letting go (unergonomic)
  • it always delays the main loop by 100ms when the button is pressed
  • it loses keystrokes the more the mainloop has to do.

A similarly easy-to-use routine, but without all of these disadvantages, can be found in the forum thread debouncing for beginners

The DEBOUNCE command in the BASIC dialect BASCOM for AVR is also programmed according to the hold pattern method. The waiting time is 25 ms as standard, but can be overwritten by the user. See BASCOM online manual for DEBOUNCE .

A C implementation for a key query with a hold pattern can be found in the article AVR-GCC-Tutorial: IO registers as parameters and variables .

The disadvantage of this method is that the controller is blocked by the waiting loop. Implementation with a timer interrupt is cheaper.

Waiting loop variant with mask and pointer (according to Christian Riggenbach)

Here is another function for debouncing buttons: With the additional code, a debouncing time of 1-3ms on average (at least 8 * 150µs = 1ms) can be achieved. Basically, the function checks the level of the pins on a specific port. If the level was constant 8 times, the loop is exited. This function can be used very well to request buttons in an infinite loop because, as mentioned, it has a short waiting time.

void entprellung( volatile uint8_t *port, uint8_t maske ) {
  uint8_t   port_puffer;
  uint8_t   entprellungs_puffer;

  for( entprellungs_puffer=0 ; entprellungs_puffer!=0xff ; ) {
    entprellungs_puffer<<=1;
    port_puffer = *port;
    _delay_us(150);
    if( (*port & maske) == (port_puffer & maske) )
      entprellungs_puffer |= 0x01;
  }
}

The function is called as follows:

  // Bugfix 20100414 
  // http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_port_pass 
  debouncing (  & PINB ,  ( 1 << PINB2 )  );  // wait for bouncing 
  if necessary (  PINB  &  ( 1 << PINB2 )  )            // then read in a stable value 
  { 
    // do something 
  else } 
  { // do something else }
  
    
  

Any value can be transferred as a mask. It prevents buttons that are not used from negatively influencing the debounce time.

Debounce macro by Peter Dannegger

Peter Dannegger described the following simplified debouncing procedure in “Debouncing for Beginners” . The macro works in the original version with active low switches, but can be easily adapted for active high switches ( Tasty Reloaded ).

/************************************************************************/
/*                                                                      */
/*                      Not so powerful Debouncing Example              */
/*                      No Interrupt needed                             */
/*                                                                      */
/*              Author: Peter Dannegger                                 */
/*                                                                      */
/************************************************************************/
// Target: ATtiny13

#include <avr/io.h>
#define F_CPU 9.6e6
#include <util/delay.h>


#define debounce( port, pin )                                         \
({                                                                    \
  static uint8_t flag = 0;     /* new variable on every macro usage */  \
  uint8_t i = 0;                                                      \
                                                                      \
  if( flag ){                  /* check for key release: */           \
    for(;;){                   /* loop ... */                         \
      if( !(port & 1<<pin) ){  /* ... until key pressed or ... */     \
        i = 0;                 /* 0 = bounce */                       \
        break;                                                        \
      }                                                               \
      _delay_us( 98 );         /* * 256 = 25ms */                     \
      if( --i == 0 ){          /* ... until key >25ms released */     \
        flag = 0;              /* clear press flag */                 \
        i = 0;                 /* 0 = key release debounced */        \
        break;                                                        \
      }                                                               \
    }                                                                 \
  }else{                       /* else check for key press: */        \
    for(;;){                   /* loop ... */                         \
      if( (port & 1<<pin) ){   /* ... until key released or ... */    \
        i = 0;                 /* 0 = bounce */                       \
        break;                                                        \
      }                                                               \
      _delay_us( 98 );         /* * 256 = 25ms */                     \
      if( --i == 0 ){          /* ... until key >25ms pressed */      \
        flag = 1;              /* set press flag */                   \
        i = 1;                 /* 1 = key press debounced */          \
        break;                                                        \
      }                                                               \
    }                                                                 \
  }                                                                   \
  i;                           /* return value of Macro */            \
})

/*
   Testapplication
 */
int main(void)
{
  DDRB  &= ~(1<<PB0);
  PORTB |=   1<<PB0;
  DDRB  |=   1<<PB2;
  DDRB  &= ~(1<<PB1);
  PORTB |=   1<<PB1;
  DDRB  |=   1<<PB3;
  for(;;){
    if( debounce( PINB, PB1 ) )
      PORTB ^= 1<<PB2;
    if( debounce( PINB, PB0 ) )
      PORTB ^= 1<<PB3;
  }
}

If the macro for the same key (pin) is to be called up in several places, a function must be created so that both calls evaluate the same state variable flag [1] :

// Hilfsfunktion
uint8_t debounce_C1( void )
{
  return debounce(PINC, PC1);
}

// Beispielanwendung
int main(void)
{
  DDRB  |=   1<<PB2;
  DDRB  |=   1<<PB3;
  DDRC  &= ~(1<<PC1);
  PORTC |=   1<<PC1; // Pullup für Taster

  for(;;){
    if( debounce_C1() )  // nicht: debounce(PINC, PC1)
      PORTB ^= 1<<PB2;
    if( debounce_C1() )  // nicht: debounce(PINC, PC1)
      PORTB ^= 1<<PB3;
  }
}

Timer procedure (according to Peter Dannegger)

Grundroutine (AVR Assembler)

See also: Forum

benefits

  • particularly short code
  • fast

In addition, 8 buttons (active low) can be processed at the same time, so they can all be pressed at exactly the same time. Other routines can e.g. B. only process one key, ie the first or last pressed key wins, or it comes out nonsense.

The actual reading and debouncing routine is only 8 instructions short. The debounced key state is in the key_state register . With only 2 further instructions, the change from key open to key pressed is recognized and stored in the key_press register . In the example code, 8 LEDs are then switched on and off. Each key corresponds to a bit in the registers, ie processing is done bit by bit with logical operations. For understanding, it is therefore advisable to paint the logic equations with gates for one bit = one key. The registers can be thought of as flip-flops that work with the debounce time as a clock. Ie you can do it z. B. in a GAL22V10.

In addition to the individual instructions, all 8 possible combinations of the 3 signals are shown as comments.

Example code for AVR (assembler):

 
.nolist
.include "c:\avr\inc\1200def.inc"
.list
.def  save_sreg         = r0
.def  iwr0              = r1
.def  iwr1              = r2

.def  key_old           = r3
.def  key_state         = r4
.def  key_press         = r5

.def  leds              = r16
.def  wr0               = r17

.equ  key_port          = pind
.equ  led_port          = portb

      rjmp   init
.org OVF0addr		;timer interrupt 24ms
      in     save_sreg, SREG
get8key:                               ;/old      state     iwr1      iwr0
      mov    iwr0, key_old             ;00110011  10101010            00110011
      in     key_old, key_port         ;11110000
      eor    iwr0, key_old             ;                              11000011
      com    key_old                   ;00001111
      mov    iwr1, key_state           ;                    10101010
      or     key_state, iwr0           ;          11101011
      and    iwr0, key_old             ;                              00000011
      eor    key_state, iwr0           ;          11101000
      and    iwr1, iwr0                ;                    00000010
      or     key_press, iwr1           ;store key press detect
;
;			insert other timer functions here
;
      out    SREG, save_sreg
      networks
;-------------------------------------------------------------------------
init:
      ldi wr0, 0xFF
      out    ddrb, wr0
      ldi    wr0, 1<<CS02 | 1<<CS00    ;divide by 1024 * 256
      out    TCCR0, wr0
      ldi    wr0, 1<<TOIE0             ;enable timer interrupt
      out    TIMSK, wr0

      clr    key_old
      clr    key_state
      clr    key_press
      ldi    leds, 0xFF
main: cli
      eor    leds, key_press           ;toggle LEDs
      clr    key_press                 ;clear, if key press action done
      be
      out    led_port, leds
      rjmp   main
;-------------------------------------------------------------

Comfort routine (C for AVR)

See also: Forum

Note If instead of active-low (hibernation high) active-high (hibernation low) is used, a line must be changed see: entire post in the forum , position 1 in the post , ( position 2 in the post * does not have to be changed, since here the polarity has no influence).

Note 2 For initialization see forum

Functional principle as above plus additional features:

  • Can save keys by different actions with short or long press
  • Repeat function, e.g. B. for entering values

The program is written for avr-gcc / avr-libc, but can also be used with other compilers and microcontrollers with a few adjustments. A port for the AT91SAM7 can be found here (from the ARM MP3 / AAC Player project ).

/************************************************************************/
/*                                                                      */
/*                      Debouncing 8 Keys                               */
/*                      Sampling 4 Times                                */
/*                      With Repeat Function                            */
/*                                                                      */
/*              Author: Peter Dannegger                                 */
/*                      danni@specs.de                                  */
/*                                                                      */
/************************************************************************/

#include <stdint.h>
#include <avr/io.h>
#include <avr/interrupt.h>

#ifndef F_CPU
#define F_CPU           1000000                   // processor clock frequency
#warning kein F_CPU definiert
#endif
 
#define KEY_DDR         DDRB
#define KEY_PORT        PORTB
#define KEY_PIN         PINB
#define KEY0            0
#define KEY1            1
#define KEY2            2
#define ALL_KEYS        (1<<KEY0 | 1<<KEY1 | 1<<KEY2)
 
#define REPEAT_MASK     (1<<KEY1 | 1<<KEY2)       // repeat: key1, key2
#define REPEAT_START    50                        // after 500ms
#define REPEAT_NEXT     20                        // every 200ms

#define LED_DDR         DDRA
#define LED_PORT        PORTA
#define LED0            0
#define LED1            1
#define LED2            2
 
volatile uint8_t key_state;                                // debounced and inverted key state:
                                                  // bit = 1: key pressed
volatile uint8_t key_press;                                // key press detect
 
volatile uint8_t key_rpt;                                  // key long press and repeat
 
 
ISR( TIMER0_OVF_vect )                            // every 10ms
{
  static uint8_t ct0 = 0xFF, ct1 = 0xFF, rpt;
  uint8_t i;
 
  TCNT0 = (uint8_t)(int16_t)-(F_CPU / 1024 * 10e-3 + 0.5);  // preload for 10ms
 
  i = key_state ^ ~KEY_PIN;                       // key changed ?
  ct0 = ~( ct0 & i );                             // reset or count ct0
  ct1 = ct0 ^ (ct1 & i);                          // reset or count ct1
  i &= ct0 & ct1;                                 // count until roll over ?
  key_state ^= i;                                 // then toggle debounced state
  key_press |= key_state & i;                     // 0->1: key press detect
 
  if( (key_state & REPEAT_MASK) == 0 )            // check repeat function
     rpt = REPEAT_START;                          // start delay
  if( --rpt == 0 ){
    rpt = REPEAT_NEXT;                            // repeat delay
    key_rpt |= key_state & REPEAT_MASK;
  }
}
 
///////////////////////////////////////////////////////////////////
//
// check if a key has been pressed. Each pressed key is reported
// only once
//
uint8_t get_key_press( uint8_t key_mask )
{
  cli();                                          // read and clear atomic !
  key_mask &= key_press;                          // read key(s)
  key_press ^= key_mask;                          // clear key(s)
  sei();
  return key_mask;
}
 
///////////////////////////////////////////////////////////////////
//
// check if a key has been pressed long enough such that the
// key repeat functionality kicks in. After a small setup delay
// the key is reported being pressed in subsequent calls
// to this function. This simulates the user repeatedly
// pressing and releasing the key.
//
uint8_t get_key_rpt( uint8_t key_mask )
{
  cli();                                          // read and clear atomic !
  key_mask &= key_rpt;                            // read key(s)
  key_rpt ^= key_mask;                            // clear key(s)
  sei();
  return key_mask;
}

///////////////////////////////////////////////////////////////////
//
// check if a key is pressed right now
//
uint8_t get_key_state( uint8_t key_mask )

{
  key_mask &= key_state;
  return key_mask;
}

///////////////////////////////////////////////////////////////////
//
uint8_t get_key_short( uint8_t key_mask )
{
  cli();                                          // read key state and key press atomic !
  return get_key_press( ~key_state & key_mask );
}
 
///////////////////////////////////////////////////////////////////
//
uint8_t get_key_long( uint8_t key_mask )
{
  return get_key_press( get_key_rpt( key_mask ));
}
 
int main( void )
{
  LED_PORT = 0xFF;
  LED_DDR = 0xFF;                     

  // Configure debouncing routines
  KEY_DDR &= ~ALL_KEYS;                // configure key port for input
  KEY_PORT |= ALL_KEYS;                // and turn on pull up resistors

  TCCR0 = (1<<CS02)|(1<<CS00);         // divide by 1024
  TCNT0 = (uint8_t)(int16_t)-(F_CPU / 1024 * 10e-3 + 0.5);  // preload for 10ms
  TIMSK |= 1<<TOIE0;                   // enable timer interrupt

  be ();

  while(1){
    if( get_key_short( 1<<KEY1 ))
      LED_PORT ^= 1<<LED1;
 
    if( get_key_long( 1<<KEY1 ))
      LED_PORT ^= 1<<LED2;
 
    // single press and repeat
 
    if( get_key_press( 1<<KEY2 ) || get_key_rpt( 1<<KEY2 )){
      uint8_t i = LED_PORT;
 
      i = (i & 0x07) | ((i << 1) & 0xF0);
      if( i < 0xF0 )
        i |= 0x08;
      LED_PORT = i;      
    }
  }
}

The single-press-and-repeat example does not work in every circuit; the following example should be more universal (single LED on / off):

// single press and repeat
if( get_key_press( 1<<KEY2 ) || get_key_rpt( 1<<KEY2 ))
    LED_PORT ^=0x08;

Newer variant that allows the following functions for a button: https://www.mikrocontroller.net/topic/48465?goto=1753367#1753367

- get_key_press()
- get_key_rpt()
- get_key_press() mit get_key_rpt()
- get_key_short() mit get_key_long()
- get_key_short() mit get_key_long_r() und get_key_rpt_l()

Extension for the detection of two buttons pressed simultaneously: https://www.mikrocontroller.net/topic/48465?goto=1753367#1753367

- get_key_common()
functionality

The code is based on 8 parallel vertical counters, which are built up via the variables ct0 and ct1

8 vertical counters in 2 8-bit variables

where each bit in ct0 together with the equivalent bit in ct1 forms a 2-bit counter. The code that takes care of the 8 counters is written so that it treats all 8 counters together in parallel.

  i = key_state ^ ~KEY_PIN;                       // key changed ?

At this point, i contains a 1 bit for each key that has changed compared to the previous debounced state (keystate).

  ct0 = ~( ct0 & i );                             // reset or count ct0
  ct1 = ct0 ^ (ct1 & i);                          // reset or count ct1

These two instructions decrease the 2-bit counter ct0 / ct1 by 1 for each bit that is set in i. If there is a 0 bit in the corresponding position in i (no change in status), the counter ct0 / ct1 is set to 1 for this bit. The basic state of the counter is as ct0 == 1 and ct1 == 1 (value 3). The counter therefore counts with every ISR call in which the key was identified as having changed compared to keystate

  ct1 ct0
    1    1   // 3
    1    0   // 2
    0    1   // 1
    0    0   // 0
    1    1   // 3
  i &= ct0 & ct1;                                 // count until roll over ?

A 1 bit is only retained in i where a 1 bit is found in both ct1 and ct0, ie the counter in question could count to 3. The additional rounding with i intercepts the case where a constant counter value of 3 in i leaves a 1 bit. In the end, this means that only a counter change from 0 to 3 leads to a 1 bit at the relevant point in i, but only if there was also a 1 bit in i at this bit position (which in turn was 1 because: a change to the last known debounced state was found at this input port). All in all, this means that a key press is recognized when the key is found 4 times in a row in a different state than the last known debounced key state.

At this point i is therefore a vector of 8 bits, each of which provides information as to whether the corresponding key was found several times in succession in the same state that does not match the last known key state. If this is the case, a corresponding change in the key status is registered in key_state

  key_state ^= i;                                 // then toggle debounced state

and if the corresponding bit in key_state has changed from 0 to 1, this event is evaluated as ‘key has been depressed’.

  key_press |= key_state & i;                     // 0->1: key press detect

This debounces the key input. This applies both when a key is pressed and when it is released (so that the bouncer is not confused with the depression of a key when released). The rest of the code then only deals with the further processing of this debounced key state.

The code part looks relatively complex due to the use of the many bitwise operations. But if you keep in mind that some of the bit-wise like a ‘parallel if’ are used simultaneously on all 8 bits, a lot will be simplified. On

    key_press |= key_state & i;

is nothing more than one

    // test whether bit 0 is set in both key_state and i 
    // and set bit 0 in key_press if this is the case 
    if (  (  key_state  &  (  1  <<  0  )  )  && 
        (  i  &  (  1  <<  0  )  ) 
       key_press  | =  (  1  <<  0  );

    // Bit 1
    if( ( key_state & ( 1 << 1 ) ) &&
        ( i & ( 1 << 1 ) )
       key_press |= ( 1 << 1 );

    // Bit 2
    if( ( key_state & ( 1 << 2 ) ) &&
        ( i & ( 1 << 2 ) )
       key_press |= ( 1 << 2 );

    ...

only performed as a much more compact operation and for all 8 bits simultaneously. The brevity and efficiency of these few lines of code results from the fact that each bit in the variables stands for a key and all 8 (maximum possible) keys go through the operations simultaneously.

How the different modes work is explained using timelines: https://www.mikrocontroller.net/topic/48465?goto=1753367#1844458

“Walkthrough” of the different states of the individual variables by pressing a button (avrfreaks.net) http://www.avrfreaks.net/comment/726676#comment-726676

Reduced to just 1 button

Discussions in the forum show again and again that many dislike this code because it seems very complicated.

The code is not easy to analyze and pulls out all the stops to save both runtime and memory usage. You often hear the argument: I only need a debouncing for 1 button, is there anything easier?

Here is the ‘long form’ of the code, as you would write for just 1 key if you used the exact same debouncing method. You can see: There is no witchcraft involved: the last known debounced state of the key is held in key_state. The pin input is compared to this state and if the two differ, a counter is counted down. If this counts down produces an underflow of the counter, the key is considered debounced and if the key is also pressed then this is noted accordingly in key_press.

uint8_t key_state;
uint8_t key_counter;
volatile uint8_t key_press;

ISR( ... Overflow ... )
{
  uint8_t input = KEY_PIN & ( 1 << KEY0 );

  if( input != key_state ) {
    key_counter--;
    if( key_counter == 0xFF ) {
      key_counter = 3;
      key_state = input;
      if( input )
        key_press = TRUE;
    }
  }
  else
    key_counter = 3;

}

uint8_t get_key_press()
{
  uint8_t result;

  cli();
  result = key_press;
  key_press = FALSE;
  sei();

  return result;
}

However, the complete debounce code, as listed above, now impresses in that it is compiled smaller than this more descriptive variant for only 1 key. And all this with increased functionality. Because e.g. an autorepeat is not yet built into this code. And at the latest when you want to debounce a 2nd key, the SRAM memory consumption of this long form is higher than that of the original for 8 keys. It follows that even for just 1 key, the original routine is the better choice.

And because of the complexity, one question: Are you able to write an efficient sqrt () function like the one you find in the standard C library? No? Then, according to your reasoning, you shouldn’t actually use the library function sqrt (), instead you would have to write a root function yourself.

Self-saturating filter (after Jürgen Schuhmacher)

By using discrete signal analysis in software, the functionality of a simple debouncing with a resistor, a capacitor and a Schmitt trigger can be simulated as in hardware by using an abstract IIR filter that emulates a capacitor charging curve. With the rule Y (t) = k Y (t-1) + input, a simple filter is generated that sluggishly follows the input value. If a certain value is exceeded, the output signal is switched with a simple query.

For assembler and VHDL with FPGAs, the following representation is suitable due to the easy-to-implement binary operations with a resolution of the filter value memory of only 8 bits: Value_New = Value_Alt – Value_Alt / 16 + 16 * (key = True). The filter value then maps the attenuated course of the input (flanked) and can suppress bouncing up to the limit for fast touching. The output value is then simply the most significant bit of the filter value.

Debouncing with IIR filter.gif

To do this, the signal from the button should ideally be sampled 10-20 times faster than the highest desired typing speed. It is possible to scan even faster, but it leads to more bits being required for the filter. The Schmittrigger function can be formed by outputting a 1 at the output when, for example, a 55% limit is exceeded and a 0 when the 45% limit is undershot. The old value is kept in the intermediate area. The real limits of this hysteresis must be adapted to the application, since too narrow limits would otherwise be too sensitive to faults.

Simple mean filter (according to Lothar Miller)

For digital circuits or PLDs, a FIR filter with flip-flops in a row is recommended. You push the input signal into a flip-flop chain and switch above the middle:

SignalInput -> FF1 -> FF2 -> FF3 -> FF4 -> FF5 -> FF6 -> FF7 -> FF8

If all FFs = 1 (sum of FFs = 8) then SignalOutput = 1
If all FFs = 0 (sum of FFs = 0) then SignalOutput = 0

This method can be mapped very simply in logic, because only one NOR or AND gate is required for the calculation of the output.

However, the real signal must be sampled slowly enough so that the filter period exceeds the bounce time to prevent an 8×1 from being seen in the middle of a passive phase of a bounce process. This makes the interation relatively slow.

Comparison of the procedures

  • HW – “debounced switch”: Very expensive, large design, subject to wear, low durability
  • HW – “switch”: requires more complex switches, requires electronics
  • HW – “switch without FF”: requires more complex switches and a small capacitor
  • HW – “capacitor debouncing”: requires a little more space, copes with bad switches
  • SW – edge method:
  • SW – holding pattern: Due to the holding pattern, a not insignificant delay in the code. Especially when several buttons are to be monitored, not unproblematic
  • SW timer: universal functionality that impresses with its low memory consumption, low computing time consumption and good function. At first glance, the ‘consumption’ of a timer looks worse than it is, because most programs use a basic timer for the time control of the program anyway, which can also be used for debouncing the buttons.
  • SW filter: very little space required in FPGAs, relatively good effect
  • SW filter 2: very small space requirement, good effect

Links on the subject

 Posted by at 6:47 pm
Mar 242020
 

 

SerialSend

SerialSend is a little command line application I created to send text strings via a serial port. I mainly use it to send information to microcontroller circuits via a USB-to-serial converter, so it’s designed to work well in that context.

  • Copyright © 2010-2019 Ted Burke, All Rights Reserved.

 Posted by at 2:31 pm
Jan 132020
 

http://vice-emu.sourceforge.net/

What is VICE?

VICE is a program that runs on a Unix, MS-DOS, Win32, OS/2, BeOS, QNX 4.x, QNX 6.x, Amiga, Syllable or Mac OS X machine and executes programs intended for the old 8-bit computers. The current version emulates the C64, the C64DTV, the C128, the VIC20, practically all PET models, the PLUS4 and the CBM-II (aka C610/C510). An extra emulator is provided for C64 expanded with the CMD SuperCPU.

News

[NEW] (24 December 2019) Version 3.4 released

  • What is NEW in the latest release? (This is definitely worth reading 🙂
  • VICE has moved its source repository to public services provided by SourceForge. You can find it at https://sf.net/projects/vice-emu. We like to thank the SourceForge staff for that help.

 

______________________________________________

 

The HP Calculator Emulators for the Atari 800XL and for the Commodore 64

In 1972 the great American company Hewlett-Packard shipped their first pocket calculator. It was called HP-35, and it was the first pocket calculator with transcendental functions and the first with the so-called Reverse Polish Notation (RPN). The HP-35 was a huge success with scientific/engineering users, so HP soon came out with a similar model for business users. It was called HP-80, and could solve problems like present and future values of payment streams, trend line calculations (least squares linear regression), ammortization, date calculation, etc. Hewlett-Packard continued with the HP-45, an improved scientific model (which I happen to own :-), and (after the models 65 and 70) with the HP-55, which was programmable and supported a quartz-controlled stopwatch function. These (so-called “classic”) calculators of HP were based upon a proprietary 4-bit CPU developed just for that purpose.I wrote emulators for these four calculators for the Atari 800XL and for the Commodore 64, which simulate the HP calculator CPU to interpret the original program ROMs of the four models. This enables you to work with your Atari 800 or C64 exactly like with the great classic HP calculators with their sophisticated scientific and business functions.

The emulators for the Atari 800XL can be downloaded here:

The emulators for the Commodore 64 can be downloaded here:

You can use these files with an Atari or Commodore emulator or put it on floppy disks and try it on the real machines.

Much more information on HP’s classic (and more modern) calculators can be found at the Museum of HP Calculators.

In the following you find screenshots of the emulators running on the Atari 800XL and on the C64.

Atari 800XL:
Norbert Kehrer's HP Calculator Emulator for the Atari 800XL Norbert Kehrer's HP Calculator Emulator for the Atari 800XL
Norbert Kehrer's HP Calculator Emulator for the Atari 800XL Norbert Kehrer's HP Calculator Emulator for the Atari 800XL
 Posted by at 5:15 pm
Dec 282019
 

http://insanity4004.blogspot.com/2019/04/simulating-vfd-gridanode-driver.html

 

Simulating the VFD Grid/Anode driver

I was reading through an old posting about the VFD Grid and Anode driver circuit I’m planning to use, when it occurred to me that the resistor between the base of the PNP transistor and the collector of the NPN transistor might not be necessary. This is labeled R1 in the schematic to the right.

To calculate the desired resistance I’d done a bunch of hand calculations in my notebook, trying various combinations of target currents and resistor values. I started to do yet another with R1 set to zero when it occurred to me that this would be easier to do in simulation. At first I entered this circuit into LTspice using 2N3904 and 2N3906 transistors, as these are standard parts in the LTspice library. The simulation results matched my hand-calculated numbers, which gave me confidence that I’d done the calculations properly. I’m driving both transistors into saturation, and my turn-off times are anything but critical, so the choice of transistor isn’t critical.

Then I wondered how closely this approximation matched the real Toshiba RN4604. At first I thought this would be a challenge, as the process for creating a Spice model description for a transistor from its datasheet isn’t that easy. Wouldn’t it be nice if Toshiba provided a Spice model? Well, they do, and it’s available for download from their website. To make it easier to probe the base current of Q1A (Q1 in the Spice schematic) I extracted the transistor models from the subcircuits that add the built-in bias resistors and substituted them into my circuit.

My original plan had been to turn on Q1A by passing about 500 µA through its base. This was based on the spec’d saturation ICE of 5 mA with IBE of 250 µA, giving an hFE of 20. In the actual application I’ve found a grid draws about 6 mA and its 10K pull-down resistor will draw another 3 mA, so I doubled IBE for an ICE of 10 mA. If I eliminate R1 the base current jumps to 606 µA. But this puts almost the full 30 volts across the input (between pins 1 and 2); the datasheet graphs stop with an input voltage of 9 V. Even with the original R1 of 10K the input voltage is almost 25 V. So I’m thinking I should revisit this.

Looking at the hFE graphs I see the worst-case (at -25°C!) current gain at 30 mA is about 100. Of course this is in the transistor’s linear region, but it implies that with a base current of 300 µA and a collector current of only 10 mA the thing will be saturated. So I tweaked my Spice simulation to sweep the value of R1 from 100 ohms to 150 Kohms. I graphed the base and collector currents of the transistor, along with the “input” voltage (the difference between pins 1 and 2 on the package). I also changed the collector load resistor to 1 KΩ to get about 30 mA collector current if the transistor was saturated. This would make it more obvious when decreasing the base drive would start having a significant effect on the collector current.

The trick to interpreting these graphs is to remember that this is a PNP transistor in a common-emitter configuration, so the base and collector currents are negative. Thus a rise in the graph means less current. Also, the horizontal scale represents ohms, even though it’s reported in volts. So the “100KV” tick actually represents 100 KΩ.

It’s pretty obvious I don’t need 500 µA of base current. In fact, it looks like I could make R1 as high as 100 KΩ and still drive this transistor into saturation. Setting R1 to 63 KΩ gives me 250 µA of base current, while 47 KΩ gives me 295 µA. I’ll probably choose 47 KΩ to allow a generous margin for variations in bias resistor values, which can vary

 Posted by at 9:41 am
Dec 282019
 

http://www.intel4004.com/

http://www.4004.com/

http://e4004.szyc.org/

 

capture

Intel 4004 Microprocessor
The emulator, assembler and disassembler is written in JavaScript, so they are easy to execute on whatever platform with the internet browser and implemented JavaScript interpreter. The MCS-4 utilities core and GUI are based on the brilliant virtual 6502 emulator by Norbert Landsteiner, e-tradition.net.

This program is provided for free and AS IS, therefore without any warranty.

 Posted by at 7:23 am
Dec 272019
 

https://wiki.analog.com/university/courses/electronics/electronics-lab-28

 

Wiki

This version (23 Aug 2019 14:04) was approved by amiclaus.The Previously approved version (05 Mar 2019 12:36) is available.Diff

Build CMOS Logic Functions Using CD4007 Array

Objective:

The objective of this lab activity is to build the various CMOS logic functions possible with the CD4007 transistor array. The CD4007 contains 3 complementary pairs of NMOS and PMOS transistors.

Making inverters with the CD4007 transistor array

Below in figure 1 is the schematic and pinout for the CD4007:

Figure 1 CD4007 CMOS transistor array pinout

 Posted by at 2:29 pm
Dec 062019
 

RLC MŮSTEK

Návod k obsluze

Obsah

Popis
Měření
Měření odporů stejnmosměrným napětím
Měření velmi malých odporů
Měření odporů střídavým napětím
Měření kapacit
Měření velmi malých kapacit
Měření indukčností
Technické údaje
Rozpiska el. součástí
Schéma
Záruka a aopravy

 


 

Ovlácací prvky můstku.
RLC můstek TESLA TM 393 je určen k měření odporů, indukčností a kapacit. Je pro provoz ze střídavé sítě a je konstruován jako provozní přístroj, kterého lze použít i pro méně přesná měření laboratorní. Široké měřicí rozsahy umožňují jeho použití v silno- i slaboproudé elektrotechnice k měření jednotlivých částí nízko- i vysokofrekvenčních obvodů.

Konstrukčně náleží do řady provozních přístrojů TESLA, konstruovaných v kovové skřínce s rukojetí.

POPIS

Přístroj sestává z vlastního můstku, ze zesilovače s usměrňovačem, z nízkofrekvenčního oscilátoru, z můstkového napájecího zdroje a galvanometru.

Veškeré tyto části jsou vestavěny do společné skříně.

Můstek

Řada normálních odporů a cejchovaný potenciometr tvoří vlastní můstek, který obsáhne rozsah dvou dekád. Pro měření kapacit přepojuje se do jednoho ramene pevný kapacitní normál 10.000 pF a potenciometr pro vyrovnávání ztrátového úhlu. Při měření indukčností se do tohoto ramene zapojuje kapacitní normál 0,1 uF a event. druhý potenciometr pro vyrovnávání ztrátového úhlu paralelně ke kapacitnímu normálu. Z tohoto důvodu jsou pro měření indukčnosti na přepínači K4 dvě polohy pro měření indukčnosti.

Zesilovač

Vestavěný zesilovač je v provozu vždy při měření kapacit a indukčností a při měření odporů pouze tehdy, měří-li se střídavým napětím. Zesilovač je dvoustupňový a zapojuje se do diagonály mostu přepínačem K 3, je-li tento přepínač v poloze ~. První stupeň zesilovače má elektronku EF 22, v jejímž anodovém okruhu je filtr LC, který slouží k omezení nižších frekvencí, hlavně síťové, kapacitně přenesené na měřený objekt. Za tímto filtrem je potenciometr, kterým se nastavuje citlivost zesilovače. Druhý stupeň je elektronka EBL 21, zapojená jako triodový zesilovač. Diodový systém této elektronky usměrňuje získaný signál pro galvanometr.

Nízkofrekvenční oscilátor

Nízkofrekvenční oscilátor je tvořen obvodem LC v obvyklém zapojení a jako oscilační elektronky je použito EF 22. Oscilátor slouží k napájení můstku při měření střídavým napětím a jeho kmitočet je přibližně 400 c/s.

Napájecí zdroj

Napájecí zdroj je tvořen síťovým trasformátorem a usměrňovací elektronkou AZ l s příslušnými vyhlazovacími kapacitami a odpory. Dodává anodové napětí pro zesilovač, žhavící napětí pro elektronky a střídavé napětí pro suchý usměrňovač, ze kterého se napájí můstek při měření stejnosměrným napětím.

Galvanometr

Galvanometr je normální ručkový přístroj s nulou uprostřed, takže při měření odporů stejnosměrným napětím indikuje i směr rozladění mostu. Při měření střídavým napětím se vychyluje ručka pouze jedním směrem.

Příslušenství

Jako příslušenství je k přístroji dodávána síťová šňůra „Flexo” a sáček s náhradními pojistkami pro síť 220 i 120 V.

Připojeni na síť

Před připojením na síť je nutné přístroj přepnout na jmenovité napětí sítě přepojovačem napětí, umístěným na zadní straně přístroje. Přepnutí provedeme po uvolnění zajišťovacího kovového pásku, vytažením a zasunutím přepínacího kotoučku tak, aby číslo udávající napětí bylo postaveno proti trojúhelníčkové značce (obr. 2). Zajišťovací pásek opět připevníme. Vlevo vedle voliče napětí je síťová pojistka P a dále síťová zástrčka. Vpravo od voliče je anodová pojistka Pa (obr. 3).

Síť zapínáme knoflíkem K2 (povytažením nebo pootočením doprava), přičemž se rozsvítí signální žárovka Z.

Kryt přístroje je zapojen na ochranný vodič.

Umístění voliče napětí a popjistek.
 

MĚŘENÍ

Měření odporů stejnosměrným napětím (obr. 4)

Stejnosměrným napětím lze měřit veškeré ohmické odpory, bez ohledu na jalovou složku. Měřený odpor připojíme na svorky RLC a vytažením

obr. 4 Schéma měření odporu.

(pootočením) knoflíku K2 uvedeme přístroj do provozu. Přepínač K3 přepneme do polohy = a přepínač K4 zapneme do polohy R.

Knoflíkem K2 nastavíme citlivost tak, aby ručka galvanometru nebyla vychýlena až na doraz. Měrný potenciometr postavíme přibližně do střední polohy a přepínačem K 5 přepneme do té polohy, ve které je výchylka galvanornetru nejmenší. Podle potřeby zvýšíme citlivost knoflíkem K2.

Nastavením potenciometru Kl (hrubě velkým knoflíkem a jemně malým knoflíkem) vyvážíme most tak, až ručka galvanornetru ukazuje na nulu. Při takto vyváženém mostě odečteme údaj na síupnici knoflíku K1 a násobíme ho číslem, na které ukazuje šipka přepínače rozsahů K5.

Při měření stejnosměrným napětím jsou funkce knoflíků K6 a K7 vyřazeny a nezáleží na tom, jak jsou knoflíky nastaveny.

Měření velmi malých odporů

Při měření velmi malých odporů je nutné dbát, aby byl vyloučen vliv přechodových odporů. Veškeré tyto odpory měříme tak, že provedeme dvoje měření. Za prvé změříme přechodové odpory tak, že přepínač K5 postavíme do polohy 0,1 Ω a svorky RLC spojíme nakrátko silným drátem. Nyní vyvážíme most a na stupnici Kl odečteme přechodový odpor Rp. Přepínači přístroje dále nemanipulujeme, zkracovací drát odpojíme ze svorek RLC a na jeho místo připojíme malý odpor, který má být změřen. Knoflíkem Kl most znovu vyvážíme a odečteme naměřenou hodnotu Rs. Správná hodnota měřeného odporu je pak rozdíl obou naměřených hodnot, tedy

R = Rs – Rp.

Protože stupnice knoflíku Kl je cejchována přímo v ohmech, je i výsledek měření udán přímo v těchto jednotkách.

Měření odporů střídavým napětím

Střídavým napětím lze měřit pouze odpory čistě ohmické nebo odpory s velmi malou složkou kapacitní nebo induktivní. Měřený odpor připojujeme rovněž na svorky RLC, přepínač K4 zůstane v poloze R, přepínač K3 přepneme do polohy ~. Potenciomelrem K2 nastavíme menší citlivost tak, aby ručka galvanometru nebyla vychýlena až na doraz. Přepínačem K5 najdeme polohu, při které je výchylka ručky nejmenší a knoflíkem K1 vyvážíme pak můstek na nulu. Knoflíkem K 2 zvýšíme citlivost a opětným dostavením potenciometru K1 můstek znovu vyválíme. Jestliže je poteneiometrem K2 nastavena velká citlivost zesilovače, nevrátí se ručka galvanometru na nulu, což je způsobeno vlastním šumem zesilovače, a pak vyvažujeme most na nejmenší výchylku, bez ohledu na to, že ručka neukazuje na nulu. I v tomto případě jsou potenciometry K6 a K7 mimo provoz a nezáleží na jejich postavení. Naměřenou hodnotu odečítáme již známým způsobem.

Měřeni kapacit (obr. 5)

Kapacity se měří pouze střídavým napětím a přepínač K3 musí být proto v poloze ~. Přepínač K4 přepneme do polohy C a měřený kondensátor připojíme na svorky RLC. Potenciometrem K2 nastavíme zprvu malou citlivost, aby ručka galvanometru nebyla vychýlena až na doraz. Přepínačem rozsahů K5 přepneme do polohy nejmenší výchylky indikátoru a most vyvážíme potenciometrem K1. Citlivost zesilovače zvýšíme a opětným dostavením knoflíku Kl vyvážíme most. Protože měřená kapacita způsobí kvalitou svého dielektrika jisté zbytkové napětí, které není s napětím procházejícím čistou kapacitou ve fázi, je ve větvi, ve které je zapojen kapacitní normál, též potenciometr K7, kterým se vliv ztrátového úhlu měřené kapacity kompensuje.

Obr. 5 měření kapacit.
 

Je tedy nutné po vyvážení mostu tímto potenciometrem, označeným na panelu „tg δ”, pootočit tak, aby se výchylka snížila. Opětným dostavením potenciometru K1 vyvážíme most. Naměřenou kapacitu čteme na stupnici knoflíku K1 a násobíme ji číslem, proti kterému je postaven přepínač rozsahů K5.

Údaj knoflíku K7 není cejchován, lze však podle jeho polohy posuzovat jakost dielektrika.

Měření malých kapacit

Při měření malých kapacit je nutné brát v úvahu i vlastní kapacitu svorek přístroje, která je asi 2 pF, a přívodů, není-li kondensátor připojován přímo na svorky přístroje. Měříme-li malou kapacitu s přívodními dráty, musíme předem změřit kapacitu těchto drátů, při čemž má být jejich poloha stejná při připojeném i odpojeném kondensátoru. Druhé měření pak provedeme s připojeným kondensátorem a výsledná kapacita měřeného kondensátoru je dána rozdílem obou naměřených kapacit.

Měření indukčností (viz obr. 6 a 7)

Pro měření indukčnosti jsou na přepínači K4 dvě polohy. Důvodem pro to je, že měřicí rozsah indukčností je velký a tím jsou i velmi rozdílné ztrátové složky měřených indukčností. Těmto polohám odpovídají i oba potenciometry K6 a K7. Je-li funkční přepínač K4 v poloze Ls, vyrovnáváme ztrátovou složku potenciometrem K6, který je v tomto případě zapojen v sérii s vestavěným kapacitním normálem. Přepneme-li funkční přepínač K4 do polohy Lp, vyrovnáváme ztrátovou složku potenciometrem K7, který se v této poloze připojuje ke kapacitnímu normálu paralelně. Všeobecně lze říci, že měření cívek je nutné provádět v té poloze přepínače K4, ve které můžeme příslušným potenciometrem pro vyrovnání ztrátové složky nastavit minimální výchylku indikátoru.

Obr.  6 a 7. Schemata měření indukčnosti.

Při měření indukčností je tedy nutné přepnout přepínač K3 do polohy ~, přepínač K4 do polohy Ls nebo Lp a měřenou indukčnost připojit na svorky RLC. Potenciometrem K 2 nastavíme menší citlivost, aby vyvažování můstku bylo snazší. Přepínačem K5 přepneme do té polohy, ve které je výchylka galvanometru nejmenší, a knoflíkem Kl vyvážíme most.

Potenciometrem pro ztrátovou složku, odpovídajícím poloze přepínače K4, otáčíme tak, aby se výchylka galvanometru dále snížila. Nelze-li otáčením potenciometru dosáhnout minima výchylky, musíme přepínač K4 přepnout do druhé polohy pro měření indukčností a vyrovnat ztrátovou složku potenciometrem příslušným této poloze. Po dosažení nižší výchylky galvanometru musíme můstek knoflíkem K1 znovu vyvážit a po zvýšení citlivosti knoflíkem K2 tento postup opakovat, až dosáhneme nejnižší výchylky obsluhou knoflíku K1 a příslušného potenciometru pro ztrátovou složku. Po takovém vyvážení můstku čteme pak naměřenou indukčnost na stupnici knoflíku K1 a násobíme ji číslem, proti kterému je nastavena šipka přepínače K5. Naměřená indukčnost je pak udána v jednotkách, které označuje šipka přepínače K5, buď v mH nebo v H.

TECHNICKÉ ÚDAJE

Rozsah odporů: 0,01 Ω  — 10 MΩ, rozděleno do osmi rozsahů; možnost měření bud stejnosměrným nebo střídavým napětím.
Rozsah indukčností: 0,01 mH — 1000 H; rozděleno do sedmi rozsahů.
Rozsah kapacit: 1 pF — 100 μF, rozdělený do sedmi rozsahů.
Přesnost měření: pro R a C ± 2%, při měření elektrolytických kondensátorů je přesnost horší; pro L ±3%.
Vlastní kapacita svorek: cca 2 pF.
Měrný kmitočet: cca 400 c/s.
Galvanometr: ±100 μA s mechanickou nulou uprostřed.
Elektronky: EF 22 —  první stupeň zesilovače,
EBL 21 — druhý stupeň zesilovače,
EF 22 — nf. oscilátor
žárovka 6,3 V/0,3 A.
Pojistky (obr. 3): síťová (P) pro 220 V … 0,4 A,
pro 120 V … 1 A,
anodová (Pa) … 0,1 A.
Napájení: střídavé napětí 120 nebo 220 V, 50 c/s.
Spotřeba: 30 W.
Rozměry: šířka 320 mm,
výška 265 mm,
hloubka 225 mm.
Váha: 9,4 kg.

ROZPISKA EL. SOUČÁSTÍ

Odpory
Označení Druh Norma
R1 karta odporová XF 681 00
R2 karta odporová XF 681 00
R3 karta odporová XF 681 03
R4 karta odporová XF 681 02
R5 karta odporová XF 681 01
R6 odpor vrstvový P1A 0024 WK 181 03/M1/D
R7 odpor vrstvový P1A 0024 WK 181 03/M1/D
R8 potenciometr 1AN 690 04
R9 karta odporová 10K XF 681 01
R10 potenciometr 1AN 69003
R11 karta odporová 10K XF 681 02
R12 potenciometr NTN 150 WN 694 02/1k/N
R13+R21 potenciometr 1AN 698 01
R14 odpor vrstvový NTN 050 TR102 2M/A
R15 odpor vrstvový NTN 050 TR102 500/A
R16 odpor vrstvový NTN 050 TR103 M2/A
R17 odpor vrstvový NTN 050 TR103 M4/A
R18 odpor drátový NTN 053 TR601 10/A
R19 odpor vrstvový NTN 050 TR102 20
R20 odpor vrstvový NTN 050 TR103 20k/A
R22 odpor vrstvový NTN 050 TR104 32k/B
R23 odpor vrstvový NTN 050 TR102 10k/A
R24 odpor vrstvový NTN 050 TR102 10k/A
R25 odpor vrstvový NTN 050 TR103 1k/A
R26 odpor vrstvový NTN 050 TR102 10k
R27 odpor vrstvový NTN 050 TR104 32k/B
R28 odpor vrstvový NTN 050 TR102 64k/B
R29 odpor vrstvový NTN 050 TR102 M16/B
R30 odpor vrstvový NTN 050 TR104 10k/A

 

Dostavovací odpory
Označení Norma Dostavovací hodnoty
Rc NTN 050 TR 103 M32 nebo M5, M8, Ml, 1M25/A
Rd PIA 0024 WK 681 03 1M6 nebo 2M5, 4M, 5M, 6M4, 8M, 10 M/C
Re PIA 0024 WK 681 03 1M6 nebo 2M5, 4M, 5M, 6M4, 8M, 10M/C

 

Kondensátory
Označení Druh Norma
C1 slídový WK 714 08/5k/D
C2 styroflexový CK 724 21/M1/D
C3 elektrolytický NTN 092 TC 500 25M
C4 svitkový NTN 060 TC 103 M5/A
C5+C8 elektrolytický NTN 090 TC 521 16/16M
C6 svitkový NTN 060 TC 104 1k/A
C7 svitkový NTN 060 TC 104 1k/A
C9 svitkový NTN 060 TC 103 50k/B
C10 svitkový NTN 060 TC 103 40k/B
C11 elektrolytický NTN 092 TC 500 25M
C12 svitkový NTN 060 TC 103 Ml/A
C13+C14 elektrolytický NTN 090 TC 521 16/16M
C15 slídový NTN 073 TC 212 4k/B
C16 svitkový NTN 060 TC 106 5k
C17 svitkový NTN 060 TC 106 5k
C25 slídový NTN 073 TC 212 4k/B

 

Dostavovací kondensátory
Označení Norma Dostavovací hodnoty
Ca slídový WK 714 08 1k nebo 2k, 5k/B
Cb slídový WK 714 08 1k/B
Cc NTN 060 TC 103 16k nebo 5k, 10k/B

SCHÉMA

Schéma se otevře ve zvláštním okně, protože je příliš velké pro vložení do textu.

ZÁRUKA A OPRAVY

Výrobní závod poskytuje na každý dodaný přístroj 6měsíční záruku podle všeobecných záručních podmínek, platných pro prodej výrobků TESLA.

Vady, které se na výrobku vyskytnou během poskytované záruční doby a budou způsobeny chybami při výrobě nebo vadným materiálem, budou bezplatně opraveny. Záruka zaniká při porušení plomby výrobního závodu nebo při provedení jakýchkoliv vlastních zásahů do elektrické či mechanické funkce přístroje.

Veškeré opravy přístrojů v záruce i mimo záruční dobu provádí výrobní závod vlastní opravnou.

Bude-li někdy třeba zaslat přístroj k opravě nebo k přezkoušení, zašlete jej dobře zabalený s popisem závady na adresu:

TESLA
národní podnik
BRNO, Čechyňská 16. Opravna tel. č. 38753


Nascannoval a do html podoby upravil Ing. Petr Jeníček. Oproti originálu byl na začátek přidán obsah. Poslední změna dne 8.5.2005.

 Posted by at 3:44 pm
Oct 172019
 

https://forum.43oh.com/topic/13361-add-msp432-support-to-arduino/

 

 Sign in to follow this  

mgh

Add MSP432 support to Arduino?

Does anyone know if MSP432 (black) can be added to the standard Arduino setup?

The reason: I’ve got an Adafruit Feather M0+ board working with Arduino, so the ARM Cortex-M compiler is “already there”. I’m hoping maybe I could remove Energia (since I don’t need the ‘430 support). If I add the JSON board file for the black MSP432 launch-pad, will the Arduino IDE get everything it needs to play with the MSP432?     https://energia.nu/packages/package_msp432_black_index.json

Also, is there a JSON file for the Tiva TM4C123 launch-pad?  (same reason, have a Tiva, want to move everything over to one IDE).

Thanks!

 

No, it is not possible as the Energia IDE includes specific features to support the multi-treading of the MSP432.

The black MSP432 is deprecated and no longer supported.

 

But I don’t care about that multitasking – does anyone know if it would work otherwise?

Yes, I know the black MSP432 has been abandoned, but I’m not going to throw away perfectly good hardware.

Thanks for the response!

 

 

  On 1/11/2019 at 2:51 AM, mgh said:

Also, is there a JSON file for the Tiva TM4C123 launch-pad?  (same reason, have a Tiva, want to move everything over to one IDE).

Thanks!

not json but instructions given for linux

https://github.com/RickKimball/tivac-core

Assumes you have openocd and arm-none-eabi-gcc in your path. Probably won’t work for windows. Probably will work for OSX.

 

Although the Arduino IDE should be able to consume the Energia packages, there is a difference between the arduino-builder in Arduino and Energia which makes the msp432 package incompatible with the Arduino IDE. See the pull request here: https://github.com/arduino/arduino-builder/pull/119. I have it on my list to find a different solution and be able to use the stock arduino-builder at which point the Arduino IDE should be able to consume the Energia package.

For TivaC and MSP430, it is possible to use it in the Arduino IDE. Just put this in the preferences: http://energia.nu/packages/package_energia_index.json. Then pull up the board manager and install TivaC support.

 

 

Wow! Thank you Rick, thank you @energia! I’ll try some of these this weekend.

 

If you want to use one single IDE for all the different boards, try

All come as freemium: free for basic features; one-time-fee or subscription for more advanced features.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It’s easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

{
  "packages": [
    {
      "name": "energia",
      "maintainer": "Energia",
      "websiteURL": "http://www.energia.nu/",
      "email": "make@energia.nu",
      "help": {
        "online": "http://energia.nu/reference"
      },
      "platforms": [
        {
          "name": "Energia MSP430 boards",
          "architecture": "msp430",
          "version": "1.0.5",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp430-1.0.5.tar.bz2",
          "archiveFileName": "msp430-1.0.5.tar.bz2",
          "checksum": "SHA-256:f40371d7e5140be6ce671aa33ca686b6d0fdfe6fd480dcb5d8dd79a87ce23305",
          "size": "2077472",
          "boards": [
            {"name": "MSP-EXP430F5529"},
            {"name": "MSP-EXP430FR2433"},
            {"name": "MSP-EXP430FR4133"},
            {"name": "MSP-EXP430FR5969"},
            {"name": "MSP-EXP430FR6989"},
            {"name": "MSP-EXP430FR5739"},
            {"name": "MSP-EXP430FR2355"},
            {"name": "MSP-EXP430FR2231"},
            {"name": "MSP-EXP430G2"},
            {"name": "MSP-EXP430G2ET"},
            {"name": "MSP-EXP430FR5994"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"msp430-gcc",
              "version":"4.6.6"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"8.2.0.1400"
            },
            {
              "packager":"energia",
              "name":"mspdebug",
              "version":"0.24"
            }
         ]
        },
        {
          "name": "Energia MSP430 boards",
          "architecture": "msp430",
          "version": "1.0.4",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp430-1.0.4.tar.bz2",
          "archiveFileName": "msp430-1.0.4.tar.bz2",
          "checksum": "SHA-256:84f752999538be0da7305f25a87ccf487008510404182feecbd6e4276642e6f2",
          "size": "2076765",
          "boards": [
            {"name": "MSP-EXP430F5529"},
            {"name": "MSP-EXP430FR2433"},
            {"name": "MSP-EXP430FR4133"},
            {"name": "MSP-EXP430FR5969"},
            {"name": "MSP-EXP430FR6989"},
            {"name": "MSP-EXP430FR5739"},
            {"name": "MSP-EXP430FR2355"},
            {"name": "MSP-EXP430FR2231"},
            {"name": "MSP-EXP430G2"},
            {"name": "MSP-EXP430G2ET"},
            {"name": "MSP-EXP430FR5994"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"msp430-gcc",
              "version":"4.6.6"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"8.2.0.1400"
            },
            {
              "packager":"energia",
              "name":"mspdebug",
              "version":"0.24"
            }
         ]
        },
        {
          "name": "Energia MSP430 boards",
          "architecture": "msp430",
          "version": "1.0.3",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp430-1.0.3.tar.bz2",
          "archiveFileName": "msp430-1.0.3.tar.bz2",
          "checksum": "SHA-256:cc4902a2bcaa43850c0e9a852f10bb5662b3eb4d4388e693d7d71c97bbdcb18a",
          "size": "2072767",
          "boards": [
            {"name": "MSP-EXP430F5529"},
            {"name": "MSP-EXP430FR2433"},
            {"name": "MSP-EXP430FR4133"},
            {"name": "MSP-EXP430FR5969"},
            {"name": "MSP-EXP430FR6989"},
            {"name": "MSP-EXP430FR5739"},
            {"name": "MSP-EXP430G2"},
            {"name": "MSP-EXP430FR5994"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"msp430-gcc",
              "version":"4.6.5"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.4.0.1099"
            },
            {
              "packager":"energia",
              "name":"mspdebug",
              "version":"0.24"
            }
         ]
        },
        {
          "name": "Energia MSP430 boards",
          "architecture": "msp430",
          "version": "1.0.2",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp430-1.0.2.tar.bz2",
          "archiveFileName": "msp430-1.0.2.tar.bz2",
          "checksum": "SHA-256:855ff60aacc129f8633cb4406dc28d1f3102d2edd05da0ba0b3123468bd1d06e",
          "size": "2243478",
          "boards": [
            {"name": "MSP-EXP430F5529LP"},
            {"name": "MSP-EXP430FR4133"},
            {"name": "MSP-EXP430FR5969"},
            {"name": "MSP-EXP430FR6989"},
            {"name": "MSP-EXP430G2"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"msp430-gcc",
              "version":"4.6.4"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.2.0.2096"
            },
            {
              "packager":"energia",
              "name":"mspdebug",
              "version":"0.24"
            }
         ]
        },
        {
          "name": "Energia MSP430 boards",
          "architecture": "msp430",
          "version": "1.0.1",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp430-1.0.1.tar.bz2",
          "archiveFileName": "msp430-1.0.1.tar.bz2",
          "checksum": "SHA-256:3d687d768013a46a580f0b24fb7e7458bc7175e9a60ecb212ea7cb4bfcd80261",
          "size": "2115215",
          "boards": [
            {"name": "MSP-EXP430F5529LP"},
            {"name": "MSP-EXP430FR4133"},
            {"name": "MSP-EXP430FR5969"},
            {"name": "MSP-EXP430FR6989"},
            {"name": "MSP-EXP430G2"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"msp430-gcc",
              "version":"4.6.3"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1594"
            },
            {
              "packager":"energia",
              "name":"mspdebug",
              "version":"0.22"
            }
         ]
        },
        {
          "name": "Energia MSP432E Ethernet RED boards",
          "architecture": "msp432e",
          "version": "5.19.0",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp432e-5.19.0.tar.bz2",
          "archiveFileName": "msp432e-5.19.0.tar.bz2",
          "checksum": "SHA-256:9d4a549ab2a5e810ee9da352dfe12b757d79a6ef2a0b9161a9c43e7fd0d42e33",
          "size": "35290227",
          "boards": [
            {"name": "MSP_EXP432E401Y"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"8.0.0.1202"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.3"
            }
          ]
        },
        {
          "name": "Energia MSP432 EMT RED boards",
          "architecture": "msp432r",
          "version": "5.23.1",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp432r-5.23.1.tar.bz2",
          "archiveFileName": "msp432r-5.23.1.tar.bz2",
          "checksum": "SHA-256:cda2b25b13920933336c95d90f555a30fc49dfbbd5477c0cf8c29523ffbd0ec3",
          "size": "31990061",
          "boards": [
            {"name": "MSP_EXP432P401R"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"8.2.0.1400"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.4"
            }
          ]
        },
        {
          "name": "Energia MSP432 EMT RED boards",
          "architecture": "msp432r",
          "version": "5.6.3",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp432r-5.6.3.tar.bz2",
          "archiveFileName": "msp432r-5.6.3.tar.bz2",
          "checksum": "SHA-256:51e9e24ed69eaef86fb1b7cd05be96269cc12a5358b77d05ad41af323466c5d8",
          "size": "28895842",
          "boards": [
            {"name": "MSP_EXP432P401R"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"8.2.0.1400"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.4"
            }
          ]
        },
        {
          "name": "Energia MSP432 EMT RED boards",
          "architecture": "msp432r",
          "version": "5.6.2",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp432r-5.6.2.tar.bz2",
          "archiveFileName": "msp432r-5.6.2.tar.bz2",
          "checksum": "SHA-256:bcde9150f6a4a703dd74dfc5fde92aa4d3ace45300188bc37f9545723576ec06",
          "size": "28893313",
          "boards": [
            {"name": "MSP_EXP432P401R"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.2.0.2096"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.3"
            }
          ]
        },
        {
          "name": "Energia MSP432 EMT RED boards",
          "architecture": "msp432r",
          "version": "5.6.1",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp432r-5.6.1.tar.bz2",
          "archiveFileName": "msp432r-5.6.1.tar.bz2",
          "checksum": "SHA-256:b2c1d36b95e5f8a5feebca25d4895ce98a46fa7d91604d4439430b62c2c2bcbd",
          "size": "28738809",
          "boards": [
            {"name": "MSP_EXP432P401R"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.2.0.2096"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.3"
            }
          ]
        },
        {
          "name": "Energia MSP432 EMT RED boards",
          "architecture": "msp432r",
          "version": "5.6.0",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp432r-5.6.0.tar.bz2",
          "archiveFileName": "msp432r-5.6.0.tar.bz2",
          "checksum": "SHA-256:fd320297acacdb3787f23e23f790770ff6242dbf86ee96702e1aaf8932aeb02e",
          "size": "28738891",
          "boards": [
            {"name": "MSP_EXP432P401R"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1624"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia MSP432 EMT RED boards",
          "architecture": "msp432r",
          "version": "4.9.1",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp432r-4.9.1.tar.bz2",
          "archiveFileName": "msp432r-4.9.1.tar.bz2",
          "checksum": "SHA-256:617aa2c65addb9e3a0831b015ce2619abafd27d86b74ad75b0449063ca10421e",
          "size": "21093293",
          "boards": [
            {"name": "MSP_EXP432P401R"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1624"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia MSP432 EMT RED boards",
          "architecture": "msp432r",
          "version": "4.9.0",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=msp432r-4.9.0.tar.bz2",
          "archiveFileName": "msp432r-4.9.0.tar.bz2",
          "checksum": "SHA-256:f765300336d56d09af2f48a94445050e5313f4d47a038220d2ad0451d5eb655f",
          "size": "21092774",
          "boards": [
            {"name": "MSP_EXP432P401R"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1624"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia TivaC boards",
          "architecture": "tivac",
          "version": "1.0.3",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=tivac-1.0.3.tar.bz2",
          "archiveFileName": "tivac-1.0.3.tar.bz2",
          "checksum": "SHA-256:d36684ab78ad516c65177d0402919814ab3681fff070d52e8036c3a13a5167ab",
          "size": "2239118",
          "boards": [
            {"name": "EK-TM4C123GXL"},
            {"name": "EK-TM4C1294XL"},
            {"name": "EK-LM4F120XL"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.2.0.2096"
            }
          ]
        },
        {
          "name": "Energia TivaC boards",
          "architecture": "tivac",
          "version": "1.0.2",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=tivac-1.0.2.tar.bz2",
          "archiveFileName": "tivac-1.0.2.tar.bz2",
          "checksum": "SHA-256:932d7d66dddf9ce4e498b737157c671b668cb450536f7223186e03955ae08041",
          "size": "2189817",
          "boards": [
            {"name": "EK-TM4C123GXL"},
            {"name": "EK-TM4C1294XL"},
            {"name": "EK-LM4F120XL"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {

              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1594"
            }
          ]
        },
        {
          "name": "Energia CC13xx boards",
          "architecture": "cc13xx",
          "version": "4.9.1",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc13xx-4.9.1.tar.bz2",
          "archiveFileName": "cc13xx-4.9.1.tar.bz2",
          "checksum": "SHA-256:9e1324c1f42ecb9b5f54b7eb33af40440809cda768e120e2d22a9d87a30d4b37",
          "size": "24263837",
          "boards": [
            {"name": "LAUNCHXL_CC1310"},
            {"name": "LAUNCHXL_CC1350"},
            {"name": "CC1350STK"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.1.0.1917"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC13xx boards",
          "architecture": "cc13xx",
          "version": "4.9.0",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc13xx-4.9.0.tar.bz2",
          "archiveFileName": "cc13xx-4.9.0.tar.bz2",
          "checksum": "SHA-256:4cf43b44a52783bb55994feed5f305b0d26f6a0cee1746cfd14168023ab9c07b",
          "size": "24260076",
          "boards": [
            {"name": "LAUNCHXL_CC1310"},
            {"name": "LAUNCHXL_CC1350"},
            {"name": "CC1350STK"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.1.0.1917"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC13xx boards",
          "architecture": "cc13xx",
          "version": "3.7.4",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc13xx-3.7.4.tar.bz2",
          "archiveFileName": "cc13xx-3.7.4.tar.bz2",
          "checksum": "SHA-256:b1fc52867179ac4b0bb69ef1f877de76ab0a8d2124d16df7bb1ed4585afba884",
          "size": "5008614",
          "boards": [
            {"name": "LAUNCHXL_CC1310"},
            {"name": "LAUNCHXL_CC1350"},
            {"name": "CC1350STK"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.1.0.1917"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC13xx boards",
          "architecture": "cc13xx",
          "version": "3.7.3",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc13xx-3.7.3.tar.bz2",
          "archiveFileName": "cc13xx-3.7.3.tar.bz2",
          "checksum": "SHA-256:55c3cd4265f65119cc6ed60dc1920a5f9762850fa0d8810f6a7735f14453bb5c",
          "size": "5008347",
          "boards": [
            {"name": "LAUNCHXL_CC1310"},
            {"name": "LAUNCHXL_CC1350"},
            {"name": "CC1350STK"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.1.0.1917"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC13xx boards",
          "architecture": "cc13xx",
          "version": "3.7.2",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc13xx-3.7.2.tar.bz2",
          "archiveFileName": "cc13xx-3.7.2.tar.bz2",
          "checksum": "SHA-256:0183e193755d6557e33d5d505c74d63f580dfbc3b424b028723e8242aa851484",
          "size": "5007077",
          "boards": [
            {"name": "LAUNCHXL_CC1310"},
            {"name": "LAUNCHXL_CC1350"},
            {"name": "CC1350STK"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.1.0.1917"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC13xx boards",
          "architecture": "cc13xx",
          "version": "3.7.1",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc13xx-3.7.1.tar.bz2",
          "archiveFileName": "cc13xx-3.7.1.tar.bz2",
          "checksum": "SHA-256:4eebf0ac52fe10be6e88482debeb51727b25a6ab1f7b28ec2417260a9132cdaf",
          "size": "5007403",
          "boards": [
            {"name": "LAUNCHXL_CC1310"},
            {"name": "LAUNCHXL_CC1350"},
            {"name": "CC1350STK"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1624"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC13xx boards",
          "architecture": "cc13xx",
          "version": "3.7.0",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc13xx-3.7.0.tar.bz2",
          "archiveFileName": "cc13xx-3.7.0.tar.bz2",
          "checksum": "SHA-256:9187d55612bf9681b76b1c20fd960021f93f869538e886cf6e109b31b7e5b0dc",
          "size": "5007247",
          "boards": [
            {"name": "LAUNCHXL_CC1310"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1624"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC13xx boards",
          "architecture": "cc13xx",
          "version": "3.6.1",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc13xx-3.6.1.tar.bz2",
          "archiveFileName": "cc13xx-3.6.1.tar.bz2",
          "checksum": "SHA-256:bbdb1404c748a9e8dc3dbad3d267c8de89d04a7aca62249b47866710ce6b6bda",
          "size": "4991866",
          "boards": [
            {"name": "LAUNCHXL_CC1310"}
          ],
          "toolsDependencies": [
            {
              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1624"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC3220 EMT boards",
          "architecture": "cc3220emt",
          "version": "5.6.2",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc3220emt-5.6.2.tar.bz2",
          "archiveFileName": "cc3220emt-5.6.2.tar.bz2",
          "checksum": "SHA-256:be0c700217218db893a504234c5dea5b9618ab7e23dfe9a370db59784de2994e",
          "size": "25967822",
          "boards": [
            {"name": "CC3220S-LAUNCHXL"},
            {"name": "CC3220SF-LAUNCHXL"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.4.0.1099"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.3"
            }
          ]
        },
        {
          "name": "Energia CC3220 EMT boards",
          "architecture": "cc3220emt",
          "version": "5.6.1",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc3220emt-5.6.1.tar.bz2",
          "archiveFileName": "cc3220emt-5.6.1.tar.bz2",
          "checksum": "SHA-256:192561fd563691c6e1559f35d8cfa8b335d77172264d491b55c000d580608110",
          "size": "25969772",
          "boards": [
            {"name": "CC3220S-LAUNCHXL"},
            {"name": "CC3220SF-LAUNCHXL"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.4.0.1099"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC3220 EMT boards",
          "architecture": "cc3220emt",
          "version": "5.6.0",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc3220emt-5.6.0.tar.bz2",
          "archiveFileName": "cc3220emt-5.6.0.tar.bz2",
          "checksum": "SHA-256:9c2d6ca0565e2dc2d0ad82c21193cc0ed0c765534fc07679f20b6f3951b6d623",
          "size": "25970182",
          "boards": [
            {"name": "CC3220S-LAUNCHXL"},
            {"name": "CC3220SF-LAUNCHXL"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"6.3.1-20170620"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.2.0.2096"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC3220 EMT boards",
          "architecture": "cc3220emt",
          "version": "4.9.0",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc3220emt-4.9.0.tar.bz2",
          "archiveFileName": "cc3220emt-4.9.0.tar.bz2",
          "checksum": "SHA-256:e59c6ba609c99c2ec6ee3856e78962c0b3301af2f67a5de42ec50e543c707919",
          "size": "19051776",
          "boards": [
            {"name": "CC3220S-LAUNCHXL"},
            {"name": "CC3220SF-LAUNCHXL"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"7.2.0.1988"
            },
            {
              "packager":"energia",
              "name":"ino2cpp",
              "version":"1.0.2"
            }
          ]
        },
        {
          "name": "Energia CC3200 boards",
          "architecture": "cc3200",
          "version": "1.0.2",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc3200-1.0.2.tar.bz2",
          "archiveFileName": "cc3200-1.0.2.tar.bz2",
          "checksum": "SHA-256:48ad1392d766fd354a368576989e42375da6e072e8337ffa2424463f5c632446",
          "size": "1791123",
          "boards": [
            {"name": "CC3200-LAUNCHXL"},
            {"name": "RedBearLab CC3200"},
            {"name": "RedBearLab WiFi Mini"},
            {"name": "RedBearLab WiFi Micro"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1594"
            },
            {
              "packager":"energia",
              "name":"cc3200prog",
              "version":"1.1.4"
            }
          ]
        },
        {
          "name": "Energia CC3200 boards",
          "architecture": "cc3200",
          "version": "1.0.3",
          "category": "Energia",
          "url": "http://energia.nu/downloads/download_core.php?file=cc3200-1.0.3.tar.bz2",
          "archiveFileName": "cc3200-1.0.3.tar.bz2",
          "checksum": "SHA-256:69f9ac0980bac4ebb8803a161786215228557eba49051af86e980aa8c422cdca",
          "size": "1790853",
          "boards": [
            {"name": "CC3200-LAUNCHXL"},
            {"name": "RedBearLab CC3200"},
            {"name": "RedBearLab WiFi Mini"},
            {"name": "RedBearLab WiFi Micro"}
          ],
          "toolsDependencies": [
            {

              "packager":"energia",
              "name":"arm-none-eabi-gcc",
              "version":"4.8.4-20140725"
            },
            {
              "packager":"energia",
              "name":"dslite",
              "version":"6.2.1.1594"
            },
            {
              "packager":"energia",
              "name":"cc3200prog",
              "version":"1.1.4"
            }
          ]
        }
      ],
      "tools": [
        {
          "name":"msp430-gcc",
          "version":"4.6.6",
          "systems":
          [
            {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/msp430-gcc-4.6.6-i686-mingw32.tar.bz2",
              "archiveFileName":"msp430-gcc-4.6.6-i686-mingw32.tar.bz2",
              "checksum":"SHA-256:3dbfe6453f461ae5d7599c3cf1144dc400852b6d788d298f3dd0004283a9202a",
              "size":"30818330"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/msp430-gcc-4.6.6-i386-apple-darwin11.tar.bz2",
              "archiveFileName":"msp430-gcc-4.6.6-i386-apple-darwin11.tar.bz2",
              "checksum":"SHA-256:82d4df153a9d64a507a48ed3b5db9e21eeb069809976c8b69946801252b622bb",
              "size":"32574759"
            },
            {
              "host": "x86_64-linux-gnu",
              "url": "https://s3.amazonaws.com/energiaUS/tools/linux64/msp430-gcc-4.6.6-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName": "msp430-gcc-4.6.6-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum": "SHA-256:41fbcb3cc73679186989e1fb27cb4578e9164f07d134e650e23089198b87cbfd",
              "size": "98503002"
            }
          ]
        },
        {
          "name":"msp430-gcc",
          "version":"4.6.5",
          "systems":
          [
            {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/msp430-gcc-4.6.5-i686-mingw32.tar.bz2",
              "archiveFileName":"msp430-gcc-4.6.5-i686-mingw32.tar.bz2",
              "checksum":"SHA-256:91496ceffdaf63562d28ca0e27d317f4e22048267efc754450f2b3cf37e69a88",
              "size":"30758086"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/msp430-gcc-4.6.5-i386-apple-darwin11.tar.bz2",
              "archiveFileName":"msp430-gcc-4.6.5-i386-apple-darwin11.tar.bz2",
              "checksum":"SHA-256:9a85b83a0015d1219157e503d0515092171c1a49a9bd695fe14a4ddfbde66ffb",
              "size":"32399439"
            },
            {
              "host": "x86_64-linux-gnu",
              "url": "https://s3.amazonaws.com/energiaUS/tools/linux64/msp430-gcc-4.6.5-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName": "msp430-gcc-4.6.5-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum": "SHA-256:0b5b4ee3e027aa88a8d86b1e5d6bd65f919084f3d3f8678475e4debdbbc930c9",
              "size": "98367482"
            }
          ]
        },
        {
          "name":"msp430-gcc",
          "version":"4.6.4",
          "systems":
          [
            {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/msp430-gcc-4.6.4-i686-mingw32.tar.bz2",
              "archiveFileName":"msp430-gcc-4.6.4-i686-mingw32.tar.bz2",
              "checksum":"SHA-256:21efce29cc6a83ddce3dbce241fcd235437ed1717f8268af169a6429d0c3d20d",
              "size":"30753419"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/msp430-gcc-4.6.4-i386-apple-darwin11.tar.bz2",
              "archiveFileName":"msp430-gcc-4.6.4-i386-apple-darwin11.tar.bz2",
              "checksum":"SHA-256:e1628d6ddce2d0ee6f9134d3d1b20560cf98cda0cb09a9c33028b3a1d210603d",
              "size":"32431529"
            },
            {
              "host": "x86_64-linux-gnu",
              "url": "https://s3.amazonaws.com/energiaUS/tools/linux64/msp430-gcc-4.6.4-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName": "msp430-gcc-4.6.4-i386-x86_64-pc-linux-gnu.tar.bz2",
              "size": "98437003",
              "checksum": "SHA-256:6595fd1dd4ebfd77aec31939e922fb4791e2c74185e908e1a4c27c50cb3b7440"
            }
          ]
        },
        {
          "name":"msp430-gcc",
          "version":"4.6.3",
          "systems":
          [
            {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/msp430-gcc-4.6.3-i686-mingw32.zip",
              "archiveFileName":"msp430-gcc-4.6.3-i686-mingw32.zip",
              "checksum":"SHA-256:5e3722f6651e33991a199f7a7f3182a3ad0d5ddb5eff199e8c27d1fd269132d2",
              "size":"47733038"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/msp430-gcc-4.6.3-i386-apple-darwin11.tar.bz2",
              "archiveFileName":"msp430-gcc-4.6.3-i386-apple-darwin11.tar.bz2",
              "checksum":"SHA-256:b919d80880603b55c64b9095eb80d4005e82d7428b0d7ded3864c200cb4f847c",
              "size":"32357793"
            },
            {
              "host": "x86_64-linux-gnu",
              "url": "https://s3.amazonaws.com/energiaUS/tools/linux64/msp430-gcc-4.6.3-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName": "msp430-gcc-4.6.3-i386-x86_64-pc-linux-gnu.tar.bz2",
              "size": "87607164",
              "checksum": "SHA-256:453832be5150f45a830ea5b0336a911f22fd7553f668a1e93a5c9e58f65f9f7f"
            }
          ]
        },
        {
          "name": "arm-none-eabi-gcc",
          "version": "6.3.1-20170620",
          "systems": [
            {
              "host": "i686-mingw32",
              "url": "https://s3.amazonaws.com/energiaUS/tools/windows/gcc-arm-none-eabi-6.3.1-20170620-windows.tar.bz2",
              "archiveFileName": "gcc-arm-none-eabi-6.3.1-20170620-windows.tar.bz2",
              "checksum": "SHA-256:c28a5c2a5272d09bf396c2dcd4c3188ae0dd8ec04d0ce8f581b1995141fc9044",
              "size": "110277553"
            },
            {
              "host": "x86_64-apple-darwin",
              "url": "https://s3.amazonaws.com/energiaUS/tools/macosx/gcc-arm-none-eabi-6.3.1-20170620-mac.tar.bz2",
              "archiveFileName": "gcc-arm-none-eabi-6.3.1-20170620-mac.tar.bz2",
              "checksum": "SHA-256:70ed9ad76f90f33a14bf47d1c2643ee5374dadef820ab38bf2ad9c3c1981aee1",
              "size": "104268677"
            },
            {
              "host": "x86_64-pc-linux-gnu",
              "url": "https://s3.amazonaws.com/energiaUS/tools/linux64/gcc-arm-none-eabi-6.3.1-20170620-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName": "gcc-arm-none-eabi-6.3.1-20170620-x86_64-pc-linux-gnu.tar.bz2",
              "checksum": "SHA-256:0a98e8cf843c41fdfdfb74cfe5b27e7b0c6054ee92ea1277812513334b6ce02a",
              "size": "100490382"
            }
          ]
        },
        {
          "name": "arm-none-eabi-gcc",
          "version": "4.8.4-20140725",
          "systems": [
            {
              "host": "i686-mingw32",
              "archiveFileName": "gcc-arm-none-eabi-4.8.4-20140725-windows.tar.gz",
              "url": "https://s3.amazonaws.com/energiaUS/tools/windows/gcc-arm-none-eabi-4.8.4-20140725-windows.tar.gz",
              "checksum": "SHA-256:2ab5a6ad2a32f976d17b7ef9222623e6f9881be908047cb05730ccd89eb79a1d",
              "size": "82014307"
            },
            {
              "host": "x86_64-apple-darwin",
              "url": "https://s3.amazonaws.com/energiaUS/tools/macosx/gcc-arm-none-eabi-4.8.4-20140725-mac.tar.bz2",
              "archiveFileName": "gcc-arm-none-eabi-4.8.4-20140725-mac.tar.bz2",
              "checksum": "SHA-256:66c9261fdd6d646931dfe940e8daf38d3b11cfba8a7e714c7a3811146b6dc9c7",
              "size": "52518522"
            },
            {
              "host": "x86_64-pc-linux-gnu",
              "url": "https://s3.amazonaws.com/energiaUS/tools/linux64/gcc-arm-none-eabi-4.8.4-20140725-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName": "gcc-arm-none-eabi-4.8.4-20140725-x86_64-pc-linux-gnu.tar.bz2",
              "checksum": "SHA-256:00636c299e7a420212cdc1643d5c52d3e82eb66c8ce0e4693327cd1e936b52db",
              "size": "68654066"
            }
          ]
        },
        {
          "name":"ino2cpp",
          "version":"1.0.4",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.4.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.4.tar.bz2",
              "checksum":"SHA-256:f1409b404eb650931ab138aea642451d0706deb19210331d3bd62bfe79099f17",
              "size":"537535"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.4.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.4.tar.bz2",
              "checksum":"SHA-256:f1409b404eb650931ab138aea642451d0706deb19210331d3bd62bfe79099f17",
              "size":"537535"
            },
            {
              "host": "x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.4.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.4.tar.bz2",
              "checksum":"SHA-256:f1409b404eb650931ab138aea642451d0706deb19210331d3bd62bfe79099f17",
              "size":"537535"
            }
          ]
        },
        {
          "name":"ino2cpp",
          "version":"1.0.4",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.4.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.4.tar.bz2",
              "checksum":"SHA-256:f1409b404eb650931ab138aea642451d0706deb19210331d3bd62bfe79099f17",
              "size":"537535"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.4.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.4.tar.bz2",
              "checksum":"SHA-256:f1409b404eb650931ab138aea642451d0706deb19210331d3bd62bfe79099f17",
              "size":"537535"
            },
            {
              "host": "x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.4.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.4.tar.bz2",
              "checksum":"SHA-256:f1409b404eb650931ab138aea642451d0706deb19210331d3bd62bfe79099f17",
              "size":"537535"
            }
          ]
        },
        {
          "name":"ino2cpp",
          "version":"1.0.3",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.3.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.3.tar.bz2",
              "checksum":"SHA-256:562c9364db80affc5a5b51a79b70950680c77d7ee62244e18bc8b6f7c114fdeb",
              "size":"485132"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.3.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.3.tar.bz2",
              "checksum":"SHA-256:562c9364db80affc5a5b51a79b70950680c77d7ee62244e18bc8b6f7c114fdeb",
              "size":"485132"
            },
            {
              "host": "x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.3.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.3.tar.bz2",
              "checksum":"SHA-256:562c9364db80affc5a5b51a79b70950680c77d7ee62244e18bc8b6f7c114fdeb",
              "size":"485132"
            }
          ]
        },
        {
          "name":"ino2cpp",
          "version":"1.0.2",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.2.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.2.tar.bz2",
              "checksum":"SHA-256:6f63041767f4f15b1da7b62aa3086e6912f9e05b19bfdf512d573bcc9ac7c9a5",
              "size":"484493"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.2.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.2.tar.bz2",
              "checksum":"SHA-256:6f63041767f4f15b1da7b62aa3086e6912f9e05b19bfdf512d573bcc9ac7c9a5",
              "size":"484493"
            },
            {
              "host": "x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/ino2cpp-1.0.2.tar.bz2",
              "archiveFileName":"ino2cpp-1.0.2.tar.bz2",
              "checksum":"SHA-256:6f63041767f4f15b1da7b62aa3086e6912f9e05b19bfdf512d573bcc9ac7c9a5",
              "size":"484493"
            }
          ]
        },
        {
          "name":"dslite",
          "version":"8.2.0.1400",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/dslite-8.2.0.1400-i686-mingw32.tar.bz2",
              "archiveFileName":"dslite-8.2.0.1400-mingw32.tar.bz2",
              "checksum":"SHA-256:793a4ea6935fd3436cc7f861b23f353609969b951b62812641635bd467814e05",
              "size":"33976575"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/dslite-8.2.0.1400-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"dslite-8.2.0.140-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:366b9139052037e480fcba4b3a4fb5783b6336b93bd5e2f3034f479a8d502784",
              "size":"17527708"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/dslite-8.2.0.1400-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"dslite-8.2.0.1400-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:f95b710f36786ba9d28c9cb96e05c812e7eba875afc69753007c8910c3bce7fd",
              "size":"19182469"
            }
          ]
        },
        {
          "name":"dslite",
          "version":"8.0.0.1202",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/dslite-8.0.0.1202-i686-mingw32.tar.bz2",
              "archiveFileName":"dslite-8.0.0.1202-mingw32.tar.bz2",
              "checksum":"SHA-256:88d45eac72682d35e907cefe101b9b32557d70a5044b872d2ac22594b87ae919",
              "size":"33554889"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/dslite-8.0.0.1202-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"dslite-8.0.0.1202-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:19ccf9a603a528c7b84237fbbcad4fdeb97dff6ff02177086cb3da9eac36041d",
              "size":"16963904"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/dslite-8.0.0.1202-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"dslite-8.0.0.1202-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:8d84a25eab60624fd216d1e8e76948ac6a218ff81cff5118c3942dc67ab78acb",
              "size":"18783730"
            }
          ]
        },
        {
          "name":"dslite",
          "version":"7.4.0.1099",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/dslite-7.4.0.1099-i686-mingw32.tar.bz2",
              "archiveFileName":"dslite-7.4.0.1099-i686-mingw32.tar.bz2",
              "checksum":"SHA-256:298f2d6df8f1122ce8ea437586dfba9c54d394144fdf7853509437a49b642bb8",
              "size":"33486116"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/dslite-7.4.0.1099-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"dslite-7.4.0.1099-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:445bfbf65a709e2e031c2670b7b0300d11b25f6a58953037f27b09c341fd7fc4",
              "size":"17016539"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/dslite-7.4.0.1099-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"dslite-7.4.0.1099-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:187aeafd49f76d841f68d5fa9cac0dcdfce9aa401fd2f2b67bd9da5c14833f67",
              "size":"18597835"
            }
          ]
        },
        {
          "name":"dslite",
          "version":"7.2.0.1988",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/dslite-7.2.0.1988-i686-mingw32.tar.bz2",
              "archiveFileName":"dslite-7.2.0.1988-i686-mingw32.tar.bz2",
              "checksum":"SHA-256:248da7bf2e882587e6e51117b8ab53eb60793aa7362836fdbc0388774367d81c",
              "size":"30119837"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/dslite-7.2.0.1988-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"dslite-7.2.0.1988-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:aa80e246122096f26df9826c8a889c45abeac96f349234c9baff7e2f27f72c36",
              "size":"15546846"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/dslite-7.2.0.1988-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"dslite-7.2.0.1988-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:f43171fac1c09567d22e070e0652dea43eebaf274467e2110cfb826f983054a0",
              "size":"18074747"
            }
          ]
        },
        {
          "name":"dslite",
          "version":"7.1.0.1917",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/dslite-7.1.0.1917-i686-mingw32.zip",
              "archiveFileName":"dslite-7.1.0.1917-mingw32.zip",
              "checksum":"SHA-256:e8ef665bfeaa9264a98771ea89d14f977e8e448116372f6883bb74dc703424a8",
              "size":"36225191"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/dslite-7.1.0.1917-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"dslite-7.1.0.1917-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:629fe0c3c5f066b9dd62e065ac8ba80c5fd260d15d6fe32006e200b9a58343ac",
              "size":"15384479"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/dslite-7.1.0.1917-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"dslite-7.1.0.1917-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:89fa13bec5e5504ccaef25a7d87464cf784c14870e66d7e149b8308839ab83de",
              "size":"17793290"
            }
          ]
        },
       {
          "name":"dslite",
          "version":"7.2.0.2096",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/dslite-7.2.0.2096-i686-mingw32.tar.bz2",
              "archiveFileName":"dslite-7.2.0.2096-mingw32.tar.bz2",
              "checksum":"SHA-256:550922c51ea0c44b1b8f47497d7dadcc81a2695d8aded478307e2d9fcec7d94d",
              "size":"33083804"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/dslite-7.2.0.2096-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"dslite-7.2.0.2096-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:2a0282a4aae506edde5999e7cffd7e8d4daf3f98df4a5ee0dccf1bb71798f471",
              "size":"16666963"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/dslite-7.2.0.2096-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"dslite-7.2.0.2096-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:4c3bff77b27a5ff811fd5b062cbe35b22867b5435e0e29d5b8a380c4ca7ad2b4",
              "size":"19132835"
            }
          ]
        },
        {
          "name":"dslite",
          "version":"6.2.1.1624",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/dslite-6.2.1.1624-i686-mingw32.zip",
              "archiveFileName":"dslite-6.2.1.1624-i686-mingw32.zip",
              "checksum":"SHA-256:fd673ea66fcd8051d91a0138dcddaf0b3104ca1c6b2e0eab0de8b2080ff70094",
              "size":"34948605"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/dslite-6.2.1.1624-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"dslite-6.2.1.1624-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:0a89afb99973ec2b4cf23be277ccc66cb2dc53fdd894924aa871b0e9882011e3",
              "size":"15312608"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/dslite-6.2.1.1624-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"dslite-6.2.1.1624-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:401d9edd1956b87a7b89f162456a8444b2ac73d3d972f8f2231a150a7e384503",
              "size":"17995725"
            }
          ]
        },
        {
          "name":"dslite",
          "version":"6.2.1.1594",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/dslite-6.2.1.1594-i686-mingw32.zip",
              "archiveFileName":"dslite-6.2.1.1594-i686-mingw32.zip",
              "checksum":"SHA-256:aa523ddddbb23fb93fd2705990a10021b3b1ad6553d6149159fc9c0f68b56824",
              "size":"33819921"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/dslite-6.2.1.1594-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"dslite-6.2.1.1594-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:f872f284b090d9c635812ef588645c498eadd1dc8ab8d867b54895d57ddf0127",
              "size":"14735532"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/dslite-6.2.1.1594-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"dslite-6.2.1.1594-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:dfa17d2c26699e1480a13bd7f2941541417c59276ee38d30848e4606e1fba33b",
              "size":"20539172"
            }
          ]
        },
        {
          "name":"mspdebug",
          "version":"0.24",
          "systems":
          [
           {
              "host":"i686-mingw32",
             "url":"https://s3.amazonaws.com/energiaUS/tools/windows/mspdebug-0.24-i686-mingw32.tar.bz2",
              "archiveFileName":"mspdebug-0.24-i686-mingw32.tar.bz2",
              "checksum":"SHA-256:7b3dfb269b58f692d03080a641f543dfe01bcfcef43935c2bb31e2839e284e73",
              "size":"1058435"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/mspdebug-0.24-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"mspdebug-0.24-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:5e0dc170ff259c4fc50a2bd591b1c10c648b9d8ad5770c03ed4228128e206fc0",
              "size":"171307"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/mspdebug-0.24-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"mspdebug-0.24-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:ec6131053a4ddd35b43d44591732313182e3487ffd77181df02ce23f0860a2e5",
              "size":"147947"
            }
          ]
        },
        {
          "name":"mspdebug",
          "version":"0.22",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/mspdebug-0.22.zip",
              "archiveFileName":"mspdebug-0.22.zip",
              "checksum":"SHA-256:e4d061b5cb1de2e17dc7f4fb5c3c6bd8c6f7a3ea013fa16e2332b408440236ec",
              "size":"201798"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"http://www.energia.nu/tools/mspdebug-0.22-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"mspdebug-0.22--x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:efc469b4771367bd5e420eb7d6f36551df8da36dd130d2bbf184131b6876111e",
              "size":"9891660"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"http://www.energia.nu/tools/mspdebug-0.22-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"mspdebug-0.22--x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:efc469b4771367bd5e420eb7d6f36551df8da36dd130d2bbf184131b6876111e",
              "size":"9891660"
            }
          ]
        },
        {
          "name":"cc3200prog",
          "version":"1.1.4",
          "systems":
          [
           {
              "host":"i686-mingw32",
              "url":"https://s3.amazonaws.com/energiaUS/tools/windows/cc3200prog-1.1.4-i686-mingw32.zip",
              "archiveFileName":"cc3200prog-1.1.4-i686-mingw32.zip",
              "checksum":"SHA-256:9701cf08a34c727355261eec502dfa44386b34b2d9cde863eb20c347d7a24f97",
              "size":"400542"
            },
            {
              "host":"x86_64-apple-darwin",
              "url":"https://s3.amazonaws.com/energiaUS/tools/macosx/cc3200prog-1.1.4-x86_64-apple-darwin.tar.bz2",
              "archiveFileName":"cc3200prog-1.1.4-x86_64-apple-darwin.tar.bz2",
              "checksum":"SHA-256:1d499a54ad083869fcc54da60ec4d55f03011fe3bb3d45dd75b5e687694befdd",
              "size":"164785"
            },
            {
              "host":"x86_64-pc-linux-gnu",
              "url":"https://s3.amazonaws.com/energiaUS/tools/linux64/cc3200prog-1.1.4-i386-x86_64-pc-linux-gnu.tar.bz2",
              "archiveFileName":"cc3200prog-1.1.4-i386-x86_64-pc-linux-gnu.tar.bz2",
              "checksum":"SHA-256:892a1ba158ee184451597cd8d1aad32f293dc4279e59deace08e2a67c6b93707",
              "size":"134860"
            }
          ]
        }
      ]
    }
  ]
}
 Posted by at 3:23 pm
Oct 112019
 

Keyboard Matrix Scanning and Debouncing

Keyboard Matrix Scanning and Debouncing

Intro

Without diving into the “why” part, I wanted to make yet another keyboard with Cherry MX keyswitches (just like everyone else these days), and I ended up deciding to make my own keyboard controller (again like everyone else). After all…

customary xkcd/927
(customary https://xkcd.com/927/ )

 Posted by at 4:28 pm
Oct 112019
 

https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv021.cgi?read=242802

 

Re: HELP WANTED ON ALGORITHMS
Message #19 Posted by Eric Smith on 27 Apr 2013, 12:49 p.m.,
in response to message #18 by Eddie W. Shore

Usually CORDIC isn’t used for logs and exponentials, although it is possible to do so by using hyperbolic CORDIC. CORDIC is in the general class of shift-and-add algorithms, and there is a simpler one for logs and exponential first published in 1624, only ten years after the invention of logarithms by Napier. I’m not sure whether the HP 9100A (1968) used Briggs’ algorithm, but all of HP’s handheld and handheld-derived calculators from the HP-35 (1972) through the Saturn-based and Saturn-emulating calculators have used it. Recent HP-designed calculators such as the HP 10bII+, 20b, 30b, and 49gII apparently use a math library based on that from Saturn calculators, so they presumably also use Briggs’ algorithm.

There is a good description of Briggs’ algorithm on Jacques Laporte’s “Briggs and the HP35” web page.

Another excellent reference for algorithms for transcendental functions is Elementary Functions: Algorithms and Implementations by Jean-Michel Muller, second edition, which covers many classes of algorithms including shift-and-add (Briggs’, CORDIC, and others), and has especially good coverage of accurate argument range reduction algorithms.

It should be noted that the HP algorithms for sine and cosine use CORDIC, but not in the most basic method normally described. Instead, they compute the tangent (or cotangent), and use an identity to compute the sine (or cosine) from it. This avoids an issue with each CORDIC iteration effectively multiplying the resulting sine and cosine by a scale factor; by using tangent (or cotangent), these scale factors cancel out. In binary CORDIC, the number of CORDIC iteration is fixed, so the result can be multiplied by the inverse of the product of the scale factors, which is constant. In decimal CORDIC as implemented by HP, the number of CORDIC iterations is variable, so it would take more work to compensate for the non-constant product of the scale factors.

For specifics of the algorithms used by HP, see:

Edited: 27 Apr 2013, 1:04 p.m.

 Posted by at 6:04 am
Oct 072019
 

https://keisan.casio.com/calculator

Advanced Calculator

 

 Function list  Input data storage
 Expression
Mode Digit Answer  Accuracy Comma format
Editor

 

(-6.2 -7.6i)!
How to use    Sample calculation    Sample chart
     
Answer
ans1 -9.85941053E-11 +3.2965092E-12i
Function List
Inserted in the cursor position of Expression
Elementary Prob Bessel Sp1 Sp2
Constant
Elementary
function
Real
numerical
function
Complex
numerical
function
Sum
Prod
Input data storage
 File 
 Term 

 Posted by at 10:42 am
Aug 192019
 

https://medium.com/@ly.lee/build-your-iot-sensor-network-stm32-blue-pill-nrf24l01-esp8266-apache-mynewt-thethings-io-ca7486523f5d

Build Your IoT Sensor Network — STM32 Blue Pill + nRF24L01 + ESP8266 + Apache Mynewt + thethings.io

Lup Yuen Lee 李立源
May 27 · 18 min read

Law of Thermospatiality: Air-conditioning always feels too warm ANDtoo cold by different individuals in a sizeable room

 Posted by at 6:48 am