summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2019-12-18 10:57:24 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2019-12-18 10:57:24 -0500
commite4603ac02c463d86b88ccd4b1a02be5e678ea270 (patch)
tree95e734e6c9236957c54af1114150a7edf76630c0
parentad9c18b47dacef7397d09353735bcd9899c0a580 (diff)
downloadnodeMCU_rf_source_lmx2487-e4603ac02c463d86b88ccd4b1a02be5e678ea270.tar.gz
nodeMCU_rf_source_lmx2487-e4603ac02c463d86b88ccd4b1a02be5e678ea270.zip
better comments
-rw-r--r--microwire.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/microwire.lua b/microwire.lua
index 1fc87b4..d50b395 100644
--- a/microwire.lua
+++ b/microwire.lua
@@ -4,13 +4,13 @@
-- Pins assignment
-- SPI Id selects which pins are used for CLK, MOSI, MISO, CS
--- lmx2487 can hadle up to 20 MHz but optocoupler is good for 240kHz
--- so let's aim to 100 kHz
-maxMicrowireInterfaceSpeed = 100000; -- in Hz
-spiID = 1; -- HSPI in nodemcu language
-databits=24
+spiID = 1; -- ID=1 --> HSPI in nodemcu language
+databits=24; -- LMX2487 loads 24 bits sequence per write into a register
-- default SPI clock is 80 MHz
fSPI = 80000000
+-- lmx2487 can handle up to 20 MHz speed (50 nS per clock) but optocoupler is good for 240kHz
+-- so let's aim for 100 kHz
+maxMicrowireInterfaceSpeed = 100000; -- in Hz
clock_divider = math.floor(fSPI/maxMicrowireInterfaceSpeed)
-- we will use SPI ChipSelect pin for LoadEnable pin
@@ -39,7 +39,7 @@ end
function microwire_send_data( data )
-- essentially send data via spi interface
- -- and raise Load Enable pin for a bit (at least for25 nS) at the end of transmission
+ -- and raise Load Enable pin for a bit (at least for 25 nS) at the end of transmission
-- first low LE pin
gpio.write(microwire_LE_pin, gpio.LOW)