Software category

Visual Studio Code Extension for Arduino is now open sourced!

Visual Studio Code is the cross-platform, open sourced advanced code editor by Microsoft.

Recently, after being interested in IoT and hardware, Microsoft is now searching for tools to make building IoT devices easier. It added an Arduino extension to its Visual Studio Code to enable a better eco-system for IoT developers using Arduino. By making some research about some challenges usually developers face, Microsoft found out that giving more access to new features and capabilities will be a pain killer for IoT enthusiasts. Later on, Microsoft had opened the source of the Arduino extension and placed it on GitHub.

 

Our Arduino extension fully embraces the Arduino developer community and is almost fully compatible and consistent with the official Arduino IDE. On top of it, we added the most sought-after features, such as IntelliSense, Auto code completion, and on-device debugging for supported boards.

Core functionalities of Arduino extension

  • IntelliSense and syntax highlighting for Arduino sketches
  • Built-in board and library manager
  • Verify and upload your sketches in Visual Studio Code
  • Built-in example list
  • Snippets for sketches
  • Built-in serial monitor
  • Automatic Arduino project scaffolding
  • Command Palette (F1) integration of frequently used commands (e.g. Verify, Upload…)
  • Integrated Arduino Debugging (New)

Of course, you can download this extension from Visual Studio Code Marketplace at: https://aka.ms/arduino.

Fortunately, Microsoft had open sourced this project on GitHub under MIT License. Thus, if you are developer, you are more than welcome to participate in developing this extension and here how you can help:

  • File a bug, submit a feature request, you can find the current bug/issue list and feature requests at GitHub’s issue tracker.
  • Join developers and users’ discussions at chat on gitter.
  • Fork the repository, fix bugs and send pull requests
  • Fork the repository, add your new cool features and send pull requests.

Finally, more detailed instructions are available at the Visual Studio Code Repo at GitHub.

Samba : Set Up Your Raspberry Pi As A Local Network File Server

Samba is the Linux implementation of the SMB/CIFS file sharing standard used by Windows PCs and Apple computers and widely supported by media streamers, gaming consoles, and mobile apps. In this tutorial, you will learn how to use a Raspberry Pi as a file server where you can save backups and share files with all the other computers on your network using Samba.

You need the following things for this tutorial:

  • A keyboard (Wired or wireless)
  • A mouse (Wired or wireless)
  • Raspberry Pi (Model 3B is recommended)
  • A 32GB (or smaller) micro SD card
  • Internet connection (Only to download Samba)

The SD card must have a reasonable amount of free storage space without requiring any extra steps to make it accessible. However, if you want extra storage, simply mount a large USB drive and create a Samba entry for it. If you want to keep your Samba file server compact and portable, install Raspbian on a 128Gb or 256GB SD card. Before purchasing, check online whether the SD card is fully compatible with Raspberry Pi or not.

Install Samba

Samba is available in Raspbian’s standard software repositories. Update your repository index, make sure that the operating system is fully updated, and install Samba using apt-get. Open a Terminal and type:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install samba samba-common-bin

The download and installation process will start and it will take a while depending on your internet speed.

Create A Shared Directory

Now you need to create a shared directory that will be accessible by other PCs/mobiles connected to the same network. You can put it anywhere, but in this tutorial, it will be at the top level of the root file system of the Pi’s microSD card. Type the following command:

sudo mkdir -m 1777 /share

To help prevent the directory from being unintentionally deleted, the above command sets the sticky bit (1) and gives everyone read/write/execute (777) permissions on the shared directory.

Configure Samba

In this step, edit the smb.conf  file to configure Samba to share the selected directory and allow users to perform various actions like read, write etc. Open the smb.conf file using the following command:

sudo leafpad /etc/samba/smb.conf

You need to add the following entry:

[share]
Comment = Pi shared folder
Path = /share
Browseable = yes
Writeable = Yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yes
Configure Samba On Raspberry Pi
Configure Samba On Raspberry Pi

As per the above configuration, anyone can read, write, and execute files in the shared directory, either by logging in as a Samba user or as a guest. Just omit the guest ok = yes line if you don’t want to allow guests. To share a larger external hard disk, simply create a smb.conf entry for the path you want to share across the network (here the external hard disk).

Create A User & Start Samba

Everything is configured and now it’s time to create a user. To set up a password for the user, enter the following command:

sudo smbpasswd -a pi

Then set a password as prompted. It’s recommended that the password should be different from your Pi’s login password. Finally, restart the Samba and set it to start automatically when the Raspberry Pi starts up. Enter the following command:

sudo /etc/init.d/samba restart

Once you’ve made sure that you can locate your shared folder on the network, you can safely disconnect the mouse, monitor, and keyboard from your Pi and just leave it running as a headless file server.

PCB Droid – First Mobile PCB Designer App

The applications available nowadays serve our everyday life well. Would it be the need of our entertainment, business life or lifestyle. However, there is one special field where we could face a serious shortcoming and it is the engineering field. I’ve come across a demand through forums specialized in electronics for a mobile application, designing printed circuits on your mobile device.

The goal was to create an application, which can be used as a designer tool for printed circuits and exporting those into different formats in an Android and Windows 10 environment. The consumption of these mobile devices is a fraction of their desktop sidekicks and an app such makes designing easier, even in your daily commute. This realization gave birth to PCB Droid application. As an electronic hobbyist as far as I’m concerned others engaged in DIY electronics usually don’t utilize the possibilities and professionalism of these programs. In practice, PC printed circuits designers are using circuit diagrams as an input. Hobbyists pretend to prefer designer programs where they can draw the marginal strips themselves and adjust them on the printed circuits. PCB Droid doesn’t require any kind of previously made circuits diagrams. The parts can be drawn onto the printed circuit by the user starting from the basic elements to the most complex components.

PCB Droid – First Mobile PCB Designer App – [Link]

Panelization – using GerberPanelizer on Windows

Arsenijs over at Hackaday.io explains how to panelize PCBs using GerberPanelizer on Windows. He writes:

This tutorial was done on Windows. Authors claim it could also be used on Linux by using Mono, but I haven’t tried and don’t understand a lot about Mono to see what could be done. I am switching to Linux nowadays, so I’d be very grateful to anybody that’d make instructions on how to launch it, however – and I’m sure other fellow Linux-wielding engineers will be grateful, too =)
This is the GitHub issue describing steps to launch it on Linux, half-successfully (thanks to @jlbrian7 for figuring this out

Panelization – using GerberPanelizer on Windows – [Link]

Free PADS PCB packages from Mentor/Digi-Key

by Graham Prophet @ eedesignnewseurope.com:

Two versions of the PADS software package (by Mentor, now a Siemens business) have been made available through distributor Digi-Key. Positioned as design software for “the aspiring innovator” both the free and the $499 versions include access to parts libraries and to a circuit simulator.

Free PADS PCB packages from Mentor/Digi-Key – [Link]

Mostly free engineering software

Michael Dunn @ edn.com has compiled a list of software that most enginners should be aware off.

We’re living in a golden age of software, where many useful programs are available – for free!

Let’s survey some of what’s out there that just might interest an engineering crowd like the EDN  community.

I can’t offer personal opinions on most of these packages, but I expect to hear back from you after you’ve test driven a few.

Mostly free engineering software – [Link]

New Release For EAGLE CAD with PCB Alignment Tools

Since Autodesk acquired Eagle CAD, big changes have been made to Eagle CAD. Regardless of the new licensing system using subscription model, which was a subject to criticism by a lot of users, the new management of Eagle from Autodesk has successfully added a lot of demanding features that old team failed to bring out.

Eagle 8 came with a lot of new features like BGA auto-router and “Past Block Design” tool to add a complete block of connected components both in schematic and board.

The new release 8.1.1 brought PCB alignment tool to align a group of objects in different positions; top, bottom, left, right, center, and distribute horizontally / distribute vertically.

Image Source: Autodesk Eagle’s Forum

Another improvement in eagle 8.1.1 that deserves mention is that a new category has been added to DRC (Design Rule Check) called Airewire. It’s an important improvement because airwires is one of the most common things designer should be aware of. In older Eagle releases, you should work with your eyes wide open and never forget to hit ratsnest at the end of your work and read the magic sentence in the bottom corner “Ratsnest: Nothing to do !”.

Image Source: Autodesk Eagle’s Forum

Source: Autodesk Eagle’s Forum

Exploring Eagle CAD ULPs #6 – Group-aps_v4.ULP Autoplace by Group

Welcome to the 6th post of the “Exploring Eagle CAD ULPs” series. Each post will be discussing one useful ULP in Eagle CAD.

“ULP” User Language Program is a plain text file which is written in a C­-like syntax and can be used to access the EAGLE data structures and to create a wide variety of output files. You can think about it as a plug-in for Eagle.

You can reach the posts published in this series using the following link.

In the previous post we explored Place50 ULP which places all parts of the board to the position in the schematic. Place50 moves all parts of the board, but sometimes we need to do this auto-placement for just a certain group of parts. Beside that, we can’t change the position scaling factor in Place50. Group-aps_v4 ULP overcomes these two points of limitation in Place50 ULP by doing the auto-placement by group, and having user defined position scaling and offset.

To use Group-aps_v4 ULP first download it from Autodesk website. Before running it in the schematic editor, you need to define a group of parts first.

Group-aps_v4 has a simple dialog to enter scale and offset values.

Scale is used to scale the value of original position (X and Y) of the parts in the defined group in the schematic. While X,Y offset is used to offset the final position of the part in the board after scaling it. For example, if scale was 0.5 and the position (in mil) for the part is (500,100) then is will be considered as (250,50).

Group-aps_v4 ULP originally places the group in the calculated position of the the first part. So as an output, all parts will have the same X and Y and that’s not effective. So i made a simple edit to the ULP to solve this issue. You can download the updated version N_group-aps_v4.ulp.

Know your Tool – Optimize C Code for microcontrollers

One of the talks in the “Embedded Linux Conference 2016” was about best practices to optimize C for microcontrollers. This talk deserves to be mentioned to Electronics-lab readers.

The presenter Khem Raj worked on Comcast’s (broadcasting and cable television company) reference design kit for STB, Gateway and IoT platforms.

We will cover some important points that have been suggested by the presenter:

Optimization Levels

Optimization in compilers in general (GCC is the one in Khem’s case) has different levels (5 Levels: Os, O1, O2, O3 and Og). Os is for size optimization while O1, O2 and O3 are for performance.

Optimization Levels - From Khem’s slides
Optimization Levels – From Khem’s slides

Linker

Linker which is an important tool in microcontrollers’ software toolchain, is mentioned in Khem’s talk.

Linker script is written in the linker command language and controls the memory layout of the output file (what goes where). Moreover, Linker can output a map file which is very useful when you want to track down references to symbols in the MCU memory.

Linker Script File - From Khem’s slides
Linker Script File – From Khem’s slides

Objdump

GNU GCC has a collection of binary tools; they are called (binutils); and objdump is one of them. It interleaves your assembly code with source code so you can do disassembling using it.

Variables

Talking about best practices with variables. If the concept of local, global, volatile, const and static are blurred for you, then watching this presentation will clarify them besides other important terms.

Khem also mentioned special integer types in C99; they are “fast” and “least” types. So you can allocate your variable like that:

  • Fixed width unsigned 8 bit integer uint8_t
  • Minimum width unsigned 8 bit integer uint_least8_t
  • Fastest minimum width unsigned 8 bit integer uint_fast8_t

To ensure portability of your code, Khem advised to use portable datatypes using uint{8,16,32,64}_t type declaration. This avoids effects of changing size of int type across different processors (compilers).

Using global and local variables is another concern. Khem advised to use local variable as much as possible. Global variable needs to be loaded from memory and stored back every time it is used. So if you use a global variable in a loop you will have multiple loading and storing operations.

Khem’s presentation has other tips about: array subscript Vs. pointer access, loop increments Vs. loop decrements and other stuff. Make sure to watch the presentation, all of it!
Slides

Exploring Eagle CAD ULPs #5 – Place50.ULP Place All Parts of The Board to The Position in The Schematic

Welcome to the 5th post of the “Exploring Eagle CAD ULPs” series. Each post will be about one  useful ULP in Eagle CAD.

“ULP” User Language Program is a plain text file which is written in a C­-like syntax and can be used to access the EAGLE data structures and to create a wide variety of output files. You can think about it as a plug-in for Eagle.

You can reach the posts published in this series using the following link.

In this post, we will discuss an autoplacer ULP. Normally, Eagle CAD places parts in the board without any considerations to electrical connections, and there isn’t any built-in auto-placing tool in Eagle.

Without the help of ULPs, you will need to do this task manually by moving connected parts near to each other. However, some ULPs can solve this problem ــ manual placement is a time consuming task when the PC can help us !.

Place50 ULP has a simple and smart idea. It’s an autoplacer which places all parts of the board to the position in the schematic. To use this ULP first download it from Autodesk website to run it in schematic. Running this ULP from schematic editor will generate a script file in your home directory. Now open board editor and run the script file “place.scr”.

I made a little edit to the original ULP to make the script file be saved in the same directory of the project rather than the home directory. Download it from here.