Skip to content

Instantly share code, notes, and snippets.

@circuit4u-medium
Created November 16, 2019 20:35
Show Gist options
  • Save circuit4u-medium/599f0b16ee3714a4505ba6e5d97292d0 to your computer and use it in GitHub Desktop.
Save circuit4u-medium/599f0b16ee3714a4505ba6e5d97292d0 to your computer and use it in GitHub Desktop.
J-lang (jsoftware) code to calculate resistor values for 555 timer IC
load 'plot'
[ scale =: +/\ 0 2 2 1 2 2 2 1
[ freq_factor =: 2^ scale % 12
[ ff =: 698.456 % freq_factor NB.go down scale from F5
[ r5 =: (% 698.456 * 1.4 * 100e_9)
[ dT =: - 2 (-/) \ % ff NB. time difference
[ rs =: dT % 1.4 * 100e_9
[ rr =: r5 , rs NB. ideal
[ rr2 =: 10e3 1.2e3 1.5e3 820 1.5e3 1.8e3 2.2e3 1.2e3 NB. redesigned
[ rb =: 10e3 1e3 2e3 2e3 2e3 2e3 2e3 2e3 NB. $3 toy
[ fr =: % (1.4 * 100e_9 * +/\rr2)
[ fb =: % (1.4 * 100e_9 * +/\rb)
plot (sort fb),(sort ff),:(sort fr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment