Logic Notes – Mike Richards G4WNC https://photobyte.org Freelance Technical Author, Illustrator & Photographer Fri, 25 Sep 2015 16:28:14 +0000 en-GB hourly 1 https://wordpress.org/?v=6.4.2 PW Data Modes ESP8266 Correction https://photobyte.org/pw-data-modes-esp8266-correction/ https://photobyte.org/pw-data-modes-esp8266-correction/#comments Sun, 16 Aug 2015 22:25:58 +0000 https://photobyte.org/?p=680  

PW Data Modes Fig 6 Corrected

I made a mistake in the diagram pin numbering showing the serial connection to the Olimex ESP8266-DEV board. The ground should connect to pin 2 as shown using the numbering in the revised Fig.6.

Apologies for the error,

 

Mike

 

]]>
https://photobyte.org/pw-data-modes-esp8266-correction/feed/ 2
Arduino Code for 0-500MHz, 1nW to 100W RF Power Meter https://photobyte.org/arduino-code-for-0-500mhz-1nw-to-100w-rf-power-meter/ https://photobyte.org/arduino-code-for-0-500mhz-1nw-to-100w-rf-power-meter/#comments Fri, 12 Jun 2015 10:00:20 +0000 https://photobyte.org/?p=645 Here is the code for the Arduino in-line power meter that will feature in my Data Modes column in the August PW.
Copy and paste the code below into your Arduino IDE:
 --------------------------------------------------------------------------------------------------------------------------
 /*
 This sketch uses the Adafruit i2c/SPI LCD backpack
 and shares some code from Adafruit
 ( http://www.ladyada.net/products/i2cspilcdbackpack/index.html )
Sketch produced by Mike Richards (G4WNC) for publication in the August issue
 of Practical Wireless magazine in the UK
 www.g4wnc.com
The LCD Backpack connections:
 * 5V to Arduino 5V pin
 * GND to Arduino GND pin
 * CLK to Analog #5
 * DAT to Analog #4
* The AD8307 voltage output connects to the Arduino A0 pin
*/
// include the library code:
 #include "Wire.h"
 #include "LiquidCrystal.h"
// Initialise the variables
 int value = 0; // Used to store the raw reading from the ADC
 float vout = 0.000; // Holds the true value of the ADC output voltage
 float powerdB = 0.00; // Calculated power in dBm
 float pWatts = 0.00; // Calculated power in watts
 float slope = 40; // Slope of the AD8307 log output (Default = 40)
 float intercept = 44.0; // 0V intercept point (Default = 44)
 float refVolts = 2.5; // Measured value of the 2.5V external reference
// Connect to the LCD via i2c, default address #0 (A0-A2 not jumpered)
 LiquidCrystal lcd(0);
void setup() {
 // Start by setting-up the pin configurations
 analogReference(EXTERNAL); // Set the Arduino to use an external reference for the ADC
 pinMode(4, OUTPUT); // Digital pin 4 is used to supply power to the voltage reference
 digitalWrite(4, HIGH); // Make sure pin 4 is high
 pinMode(A0, INPUT); // Enable the first (A0) input to the ADC
 // set up the LCD's number of rows and columns:
 lcd.begin(20, 4); // Set 4 lines of 20 characters
 // Print a message to the LCD.
 lcd.setCursor(0,0); // set the cursor to the top left, line 0 column 0
 lcd.print("Arduino Power Meter"); // Message on the top line of the display
 lcd.setBacklight(HIGH); // Turn the backlight on to make the display visible
 //Now print the measurement labels
 lcd.setCursor(0,1); // move the cursor to the first position on the 2nd line
 lcd.print("AD8307 Volts: "); // print the label
 lcd.setCursor(0, 2); // Move the cursor to the start of the 3rd line
 lcd.print("Power (dBm): "); // Print the label
 lcd.setCursor(0, 3); // Position the cursor
 lcd.print("Power (Watts):"); // Print the label
 }
void loop() {
value = analogRead(0); //read the ADC and store the result in value
 vout = (value*refVolts)/1023; // Convert the ADC result to volts in vout
 powerdB = (slope*vout)-intercept; // convert the voltage to dBm in 50 ohms
 pWatts = pow(10.0,(powerdB -30)/10.0); // convert dBm to watts
 lcd.setCursor(13, 1); //Move the cursor to the 13th position
 lcd.print(vout,3); // Display the AD8307 voltage
 lcd.setCursor(13, 2); // Position the cursor
 lcd.print(" "); // Print spaces to clear the last result
 lcd.setCursor(13, 2); // Position the cursor
 lcd.print(powerdB,1);// Display the power in dBm
 lcd.setCursor(15,3); // Position the cursor
 lcd.print(" "); // Print spaces to clear the last result
 lcd.setCursor(15,3); //Position the cursor
 lcd.print(pWatts,1);// Display the power in watts
 }
]]>
https://photobyte.org/arduino-code-for-0-500mhz-1nw-to-100w-rf-power-meter/feed/ 21
Cypress – Super-Cheap PSoC Development Boards https://photobyte.org/cypress-super-cheap-psoc-development-boards/ https://photobyte.org/cypress-super-cheap-psoc-development-boards/#respond Tue, 25 Nov 2014 15:38:11 +0000 https://photobyte.org/?p=430 Cypress have recently introduced a new range of PSoC 4 development boards that are well worth a look Based on the 4100 and 4200 series of PSoC devices they feature a powerful Cortex M0 processor, include a programmer and are available from Farnell for less than £4 each. The PSoC Creator visual design software is free so you can get up and running with PSoC programming with very little outlay. There are also plenty of example programs plus extra user components available on the Cypress website.

 

The one weak point is the programming instructions that don’t really cover the USB connected development boards but assume you have a PSoC programmer. The solution to is use the following excellent Wiki that provides step-by-step instructions on USB bootloader programming: Bootloader Wiki.

 

]]>
https://photobyte.org/cypress-super-cheap-psoc-development-boards/feed/ 0
UKHASnet Update https://photobyte.org/ukhasnet-update/ https://photobyte.org/ukhasnet-update/#respond Mon, 13 Oct 2014 15:54:30 +0000 https://photobyte.org/?p=406 One of the highlights of the 2014 RSGB Convention for me was the opportunity to meet James Coxon and see his presentation on the formation and development of UKHASnet. For those that haven’t come across it, UKHASnet is a relatively new and rapidly developing low power data network. Initially designed for use by the High Altitude Balloon enthusiasts, the simple protocols combined with cheap processors and licence exempt RF modules make HASnet an interesting choice for all manner of ad-hoc networks. A commonly quoted example is to build simple temperature monitors and locate them around the house and employ the HASnet to link them all together. You can build a low-cost node complete with temperature sensor with a small handful of components. Many of the current node designs are Arduino based and use an ATmega 328 chip with a Hope RFM69 RF module. You can build a node using stripboard but there are some very interesting and cheap designs available from the US. The LowPowerLab Moneino range is ideal as they provide an ATmega328 chip complete with regulator and a RFM69 RF module all mounted on a neat PCB. This can be programmed using the normal Adruino IDE  so it gets you off to a head start. The boards currently cost around £12 each and postage to the UK is approx £6 per order for USPS 1st class which takes a couple of weeks. If you’ve got a big order you could get it quicker but the shipping cost goes up to about £16.

Another supplier worth watching is Anarduino as they supply lots of similar boards but are currently revising their range.

I’ve got a few boards on order so watch out for my columns in PW and Radio User for more information.

]]>
https://photobyte.org/ukhasnet-update/feed/ 0
New Free STM32 development Software https://photobyte.org/new-free-stm32-development-software/ https://photobyte.org/new-free-stm32-development-software/#respond Wed, 26 Mar 2014 09:04:34 +0000 https://photobyte.org/?p=327 STM have recently announced a brand new visual development package for their STM32 range of embedded devices. I’ve been a fan of STM for some time as they produce excellent and powerful  development boards at very reasonable prices. The recently introduced Nucleo range are very powerful devices costing just under £8 each! Initialising these chips can be a bit of a pain, involving a study of the data sheet to work out timer and peripheral setup values. STM have recognised that problem and developed the STM32Cube MX as a free solution.

This standalone, free, software package helps you set up all the peripherals in a visual format. This includes all the communication port options as well as the clock chain. The visual clock programming is a real breakthrough as the software provides a simple block diagram of all the clocks showing how they interact. Once you’ve set-up the interfaces and clocks, the Cube MX software generates C code that you can use as the foundation for your project. This is a real boon as not only does it save time but it ensures that you have optimised setup code.

The STM32Cube MX sofware can be downloaded from here.

 

]]>
https://photobyte.org/new-free-stm32-development-software/feed/ 0
New Mbed supported STM32 Nucleo boards https://photobyte.org/new-mbed-supported-stm32-nucleo-boards/ https://photobyte.org/new-mbed-supported-stm32-nucleo-boards/#respond Wed, 05 Mar 2014 11:10:02 +0000 https://photobyte.org/?p=321 The eagerly awaited collection of new Mbed boards have arrived from STM. The STM Nucleo range are budget priced, Cortex development boards with Arduino compatible shield connectors, integral ST-Link programmer and are fully supported on the Mbed development platform. If you haven’t encountered Mbed you’re missing a trick. Mbed is a free on-line IDE that has a host of library functions available that can be easily added to any project. Moving your program to the target device is a simple drag and drop process.

The new Nucleo boards are fantastic value priced at just under £8 each from Farnell. The four boards in the initial launch cover M0, M3 and M4 Cortex processors with an assortment of ADCs, DACs and communications interfaces.

 

 

 

]]>
https://photobyte.org/new-mbed-supported-stm32-nucleo-boards/feed/ 0
Cypress System on Chip Entry Kit https://photobyte.org/cypress-system-chip-entry-kit/ https://photobyte.org/cypress-system-chip-entry-kit/#respond Sat, 04 Jan 2014 13:53:33 +0000 https://photobyte.org/?p=289 System on a Chip (SoC) devices are becoming ever cheaper and represent a great way to develop micro controller apps with the minimum of external components. A typical SoC device comprises a micro controller core along with a stack of logic and analogue blocks that can be configured in firmware to create a specialist device.

Up until recently, development kits for this technology have been too pricey for the enthusiasts market but that is changing rapidly. The latest to come to my attention is the Cypress CY8CKIT-042 PSoc Pioneer Kit. This has everything you need to get started including an on-board programmer, USB lead and some patch wires. The development software is completely free and downloadable from the Cypress site. One of the great things about this system is the PSoc 4 Creator software that allows you to create and  program your dedicated applications by simply drawing the circuit diagram! The kit also has Arduino compatible pin layout and sockets for Digilent Pmod accessories so it’s easy to expand the board.

At the time of writing the kit was available from Farnell for about £17 which is a real bargain. Here’s a link for more information: http://uk.farnell.com/cypress-psoc-4-pioneer-kit

 

 

 

]]>
https://photobyte.org/cypress-system-chip-entry-kit/feed/ 0
New STM32 Development board with 2.4″ Touch Screen for £17! https://photobyte.org/new-stm32-development-board-2-4-touch-screen-17/ https://photobyte.org/new-stm32-development-board-2-4-touch-screen-17/#respond Fri, 13 Dec 2013 13:27:41 +0000 https://photobyte.org/?p=284 I spotted this new development board from STM a few weeks ago and stock has now arrived at Farnell. This is an amazing value board that features a STM32F4 180MHz cpu with 3-axis MEMS sensor and a 2.4″ QVGA touch-screen display. The board comes preloaded with a neat graphic display example.

Development with this board has been made easy thanks to the provision of free example software, development IDE and the STemWin professional graphical library.

The package cost just under £17 which is remarkable value. You can order yours from Farnell using this link.

]]>
https://photobyte.org/new-stm32-development-board-2-4-touch-screen-17/feed/ 0
Papilio https://photobyte.org/papilio/ https://photobyte.org/papilio/#respond Thu, 05 Dec 2013 17:23:22 +0000 https://photobyte.org/?p=271 If you are thinking of getting into FPGAs (Field Programmable Gate Arrays) it’s worth paying a visit to Gadget Factory’s Papilio project. Not only do they have some great value boards available but the new Schematic Library really helps you get going with minimal programming. The Schematic library provides computing modules that can be arranged and connected together using simple block schematic diagrams. A processor is included in the set, so it’s remarkably easy to program your FPGA board with an Arduino like processor along with a wide assortment of interfaces.

I’ve bought one of the Papilio One FPGA boards with a 250k gate Spartan 3E chip. In addition to the obvious FPGA chip, the board comes with all the essential voltage regulators, a clock source and its own JTAG programmer. There are two expansion wings for all the ins and outs and a USB port for the programmer. With the Palipio One board selling at just $38 (~£23) it’s great value. If you want to see more, take a look at the Learning site where you’ll find lots more detail along with examples.

]]>
https://photobyte.org/papilio/feed/ 0
CPLD Development Boards https://photobyte.org/cpld-development-boards/ https://photobyte.org/cpld-development-boards/#respond Wed, 09 Oct 2013 11:18:21 +0000 https://photobyte.org/?p=262 I’ve been spending a lot of time recently playing with CPLDs (Complex Programmable Logic Devices). These are wonderful devices for the logic experimenter as you can build your own dedicated logic chips! I started by getting the excellent Guzunty Pi which is an excellent value board complete with software that allows you to load different cores onto the CPLD that forms the heart of the Guzunty Pi.

I’ve also discovered an excellent CPLD development board that’s produced by Seeed Studio. This contains the same Xilinx chip as the Guzunty Pi but programming needs to be done via a JTAG lead. The board costs just $15 and postage was reasonable. There are several routes to get the necessary JTAG cable but the cheapest options are to either get a Xilinx clone cable from eBay or get the Digilent JTAG programming cable from Farnell. If you prefer to get your CPLD development board from the UK then Farnell hold the Digilent C-Mod board at £15.31.

To make your own CPLD cores you will need development software and the best option for the Xilinx chips is their free ISE WebKit.

Look out for my next Data Modes column in PW for more details.

 

]]>
https://photobyte.org/cpld-development-boards/feed/ 0