Friday, February 24, 2017

ESPBasic Series : Decimal-to-Binary conversion


   I was looking a while ago to implement some Decimal-to-Binary conversion subroutine to be used for easy visualisation of the Registry content. Been able to see the values directly binary can help a lot when developping a driver for a IC or any piece of related software:


1. Decimal-to-Binary subroutine:
 [decbin]
  i = 1
  r = 0
  binval = 0
  nr = decval
 Do
   r = nr % 2
   nr = int(nr/2)
   binval = binval + r*i
   i = i*10
 Loop while nr > 0
wait

  2. Test Program:
decval = 0
binval = 0
wprint "<br><br>Decimal value "

textbox decval
button " Convert ", [decbin]

wprint "<br><br> Binary value "
textbox binval
wprint "<br><br>"
button " Exit ", [TestExit] 
Wait

[TestExit]
 Looking forward to see your own ideas about!

Happy breadboarding,
TJ.

Friday, February 17, 2017

MPRSx8 - ESPEasy Firmware P2 - Upload with standard USB-to-Serial Adapter

The MPRSx8 - Home Automation DevBoard meets ESPEasy Firmware :)

MPRSx8 Board is available also on Tindie store: https://www.tindie.com/stores/nEXT_EVO1/

For MPRSx8 general presentation and hardware description please take a look also at Part 1 of the MPRSx8 series:http://www.esp8266-projects.com/2016/11/wifi-mains-8x-relay-board-for-home.html



Part 2 of the series, ESPEasy Firmware Upload tutorial using a simple standard USB-to-Serial Adapter:





The story behind:
 
   Somebody was asking if is really possible to upload firmware with a simple USB to serial adapter, as the ones that are available all over the place. As you can see from the above step-by-step tutorial it is possible and is working very smooth. You are loosing the autoreset and autoupload capabilities of the USBProg board, but as long as you are doing rarely the firmware upload is not so bad. 
   On the other hand, if you want to use it with Arduino IDE or anything else that means frequent upload then I think you will start looking after that functions sooner or later, I think more sooner than later :) 


What we will need:
         - CP2102 version
         - Another even smaller size version
         - extra pinout version
         - FT232 Version - Full pinout. Looks nice but because of the FTDI horror stories I would probably stay away from it.


Next time we will move further with the ESPEasy firmware configuration, see here Part 3: ESPEasy Firmware configuration for Domoticz integration.

Thursday, February 16, 2017

ESPBasic Series - DEC to BCD and BCD to DEC conversions


In the process of working on a new Driver Tutorial for the ESPBasic Series I am looking today to implement some Decimal-to-BCD and BCD-to-Decimal subroutines.

What I have done so far:

1. BCD-to-Decimal subroutine:
[DEC]
hv = val >> 4
hl = val and 15
val = hv*10 + hl
wait 
 2. Decimal-to-BCD subroutine:
[BCD]
d = int( val / 10 )
d1 = d * 10
d2 = val - d1
val = d*16 + d2
wait

 3. Test Program
let val = 96
textbox val
button "To DEC", [DEC]
button "To BCD", [BCD]
wprint "<br><br>"
button " Exit ", [TestExit]
wait

[TestExit]
end


If you have any other idea please feel free to share it, looking forward to see smarter solutions that that. I'm sure they are!

Happy breadboarding,
TJ.

Thursday, February 9, 2017

ESPEasy Series - MPRSx8 Home Automation Board - Part 1


The MPRSx8 - Home Automation DevBoard meets ESPEasy Firmware :)

MPRSx8 Board is available also on Tindie store: https://www.tindie.com/stores/nEXT_EVO1/

For MPRSx8 general presentation and hardware description please take a look also at Part 1 of the MPRSx8 series:http://www.esp8266-projects.com/2016/11/wifi-mains-8x-relay-board-for-home.html



Part 1 of the series, ESPEasy Firmware Upload tutorial:





What we will need:
Next time we will see how to upload ESPEasy firmware using a standard USB adapter.