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:
  i = 1
  r = 0
  binval = 0
  nr = decval
   r = nr % 2
   nr = int(nr/2)
   binval = binval + r*i
   i = i*10
 Loop while nr > 0

  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] 

 Looking forward to see your own ideas about!

Happy breadboarding,

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:

For MPRSx8 general presentation and hardware description please take a look also at Part 1 of the MPRSx8 series:

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, preparing the board for Domoticz integration.