1 2 3 Previous Next

Embedded

400 posts

Most of the software that most of us use most of the time is obtained as a binary executable. The program may be run and does what it does, but the user has no knowledge of its inner workings and no opportunity to modify its functionality. And all of this is fine. For example, I am writing this posting on my PC using a Windows program. Later, I will probably review it on my iPad using the corresponding app. The two programs are probably written in different languages by different teams. Do I care? Nope. The important thing to me is the data [my text] and what the software does with it.

In the world of embedded software, things are a bit different …

The difference is not with programs that are run on a PC – compilers, debuggers etc. These are also normally provided as binary executables and used in much the same way as other application software. Of course, there are open source options, but a large proportion of users will never dirty their hands on the source code. The different approach applies to software IP [intellectual property] – code which is to be incorporated into a design. The best example of such IP is a real time operating system [RTOS].

To read the rest of this entry, visit the Colin Walls blog via Mentor Embedded.

RTOS.PNG

ARM Connected Community Board Breakdown (2).png

Happy Monday (I can be sincere in that sentiment today since it is my Spring Break)! This week we are going to mix it up with a pretty unique board from Atmel. I am referring to the SAM4L8 Xplained Pro with the Cortex®-M4 processor. It includes an ATSAM4LC4C microcontroller board that that starts out light-weight on peripherals but can be be extended with the four extension headers to customize without necessarily needing an external breadboard. The starter kit comes with a handful of the "wing" boards but there are additional modules you can purchase to have the board fit your needs. It was fun trying out this board because it's a model I haven't really encountered before and I've seen a few boards at this point! The real question now is how do YOU get your hands on this board?* Comment below (here in the Connected Community) with how you would use this board for a chance to win! The winner will be announced by noon on Friday, April 3, 2015.

atmel.JPG

Image courtesy of Atmel.com


Hardware

From a design aspect I have needed to take the physical size of the board into account, what voltage supply/ battery pack to purchase, the number of break out pins available for sensors, price and available documentation. These aspects have therefore been noted in case they are important to anyone else’s design.

Software

The benchmarking for software was determined by the available IDEs, native languages, time to get started and the like.

  • Tutorials (YouTube, main page, etc)
  • Time to get Hello World program working
    • The Atmel Studio was suggested for developing so I decided to try it. It took some time to download and update the libraries but after that it was fairly smooth. There are a number of sample projects pre-loaded that you can choose from and the IDE automatically recognizes the board plugged in and all of the extension boards. Both of those were very nice features for a quick start up since I didn't have to worry about linking the right libraries and had a reference for the API calls, both of which can shorten the learning curve. The time to get working is therefore more dependent on your internet connection to download than anything else.
  • Languages
    • C
    • C++
  • Programming Environments
    • Atmel Studio
    • IAR™
    • GCC-based IDEs including Eclipse

 

Projects & Community

Whenever you take on a new project it is always nice to see what other people have done. Therefore the last section is dedicated to the resources already available.


Opinion time:

What I appreciate about the SAM4L8:

I am intrigued by the expansion capabilities of this board- most boards have all of the peripherals there whether you like it or not whereas the Xplained series allows the user to customize it to be whatever you want it to be. This makes the platform a little bit bigger but the wings also mean the Studio automatically recognizes them and you can start prototyping without worry of whether it will work or not. It. just. works. If you need a proof of concept and you don't have a lot of time to get it done then the combination of this platform and the Atmel Studio can get you there!

 

 

*Please be aware that if there is an export restriction you may not be eligible to receive the board. Please PM if you have any questions or concerns.

 

Warning on biases: I am a senior Computer Engineering student with a background in embedded systems. I have worked with a variety of ARM-based boards for projects over the years. I acknowledge that I have my own set of preferences based off of what has worked well in the past but I have tried to be as impartial as possible since not everyone has the same project goals.I am an intern at ARM but these opinions are my own. The donations aren't going to change my opinions- I don't get to personally keep them after the review. Instead they will be here at the ARM office in case any of our awesome Community members has a question that requires more than a dive into the schematics =). Finally, if you have had a different experience I welcome your feedback.

Although not yet finalized, the deal provides for some interesting synergies in the MCU market. NXP is well positionned with semi-custom MCUs for the mobile industry, while Freescale has been gaining momentum in the standard MCU arena. Although their portfolios overlap... Read on

Software is an interesting kind of product. The most complex artifacts that humankind has ever made are items of software. Mechanical machines do not even come close. The most complex machine ever made, with about a million moving parts, was the Space Shuttle orbiter. The “moving parts” of software are bits of data; a program that includes a billion bits is not uncommon.

This complexity means that software development is eye-wateringly expensive. On the other hand, compared with other manufactured goods, the manufacturing, warehousing and distribution of software [and other electronic IP] is very cheap – maybe even free. This leads to some interesting results in the marketplace …

The success of conventional products is often measured in the number of units shipped. A good example is cars, which are commonly cited as a metric for the state of the economy. Although the monetary value is important, the number of units also counts. With software products, the unit count seems to be even more important. This is very apparent when you consider freeware, shareware and open source software, where copying is actively encouraged. The disruptive effect of the low manufacturing/reproduction cost leads some people to very odd conclusions, like an assertion that all software should be free. This is plainly ridiculous, as the development needs to be paid for somehow [and, anyway, “there ain’t no such thing as a free lunch”]. But I digress …

If the most successful software is that which is in widest use – i.e. has the most instances in existence – it should be quite easy to identify. So, what is it?

To read the rest of this entry, visit the Colin Walls blog via Mentor Embedded

3b-520x112.png

Wondering how these cores can speed up your algorithms ?

 

Following article details usage of Cortex-M4 & Cortex-M7 DSP extension in C to perform parallel comparison on a Mix/Max detection algorithm example.

It shows both C sources and corresponding compiler outputs to explain gains that can be expected for such algorithm.

 

Parallel comparison – Min/Max detection | ARM Cortex M4 & M7 Unleashed

Technical Machine recently announced their latest Wi-Fi dev platform for the burgeoning Internet of Things (IoT). The Tessel 2 packs a number of new features as its predecessor, including extremely reliable Wi-Fi, an Ethernet jack, a pair of USB ports, and a system that runs real Node.js/io.js. Beyond that, the team has added support to enable Makers to scale and streamline production.

tessel2-800x600-1.jpg

“The Tessel platform was created to abstract away the initial hurdles of hardware development. Tessel opens up connected device development to people who want to build embedded devices, but don’t have the time to start with Ohm’s law and work their way up. Tessel 2 takes the promise of Tessel 1, adds features and a path to production, and cuts the cost in half,” the crew writes.

The original Tessel was designed to be an extremely expedited way to devise prototypes through high-level languages, plug-and-play extensibility and the use of a great package manager for installation. However, no matter how quickly you got started, it was a bit difficult to ever go beyond just a single mockup. Subsequently, its creators sought out the most reliable Wi-Fi chips on the market, before finally finding a solution in wireless router systems-on-chips.

The new dev platform employs a processor/coprocessor architecture, combining an Atmel | SMART SAM D21 Cortex M0+ MCU to control I/O and a Mediatek MT7260n Wi-Fi router SoC to run user code, host USB devices and handle the network connections. The two chips are connected by a SPI bridge that includes the on-board Flash. Other notable features entail 64 MB of DDR2 RAM, 32 MB of Flash storage, two high-speed USB 2.0 ports, a microUSB port, an Ethernet port, two module ports, a button, a bunch of LEDs, and of course, it is still programmable with JavaScript.

tumblr_inline_nkz56hkzbm1s75tgz.png

The SAM D21 acts as a coprocessor and handles real-time, low-level I/O through the module ports, USB communications, as well as programming the device altogether. Meanwhile, the entire system is powered by the single microUSB device port.

Tessel 2 is equipped with router-grade 802.11b/g/n Wi-Fi, 16 GPIO broken out as a pair of multi-purpose module ports, individual control over and protection for all outward-facing power buses (USB and module ports), and a form factor designed for abstraction and flexibility in the hardware, software, and mechanical worlds as you scale from prototype to production. Beyond that, Tesel 2 runs 20 times faster than its older sibling, offers full Node and io.js, and supports Rust and Python along with other languages in the near future.

“The board’s bill of materials and physical characteristics are only part of the picture. We spent a long time thinking about how we wanted to architect Tessel to push it beyond ‘another dev board’ and clear into ‘this platform is exactly what I needed’ territory,” Technical Machine’s Eric Kolker explains.

Still, the latest iteration of the board includes an expansive plug-and-play ecosystem, ranging from an accelerometer and infrared to BLE and distance modules.

“Tessel 2 supports USB modules, so a USB webcam, USB speakers, and a few other modules will move into this sphere. This will allow us to reduce the cost of these modules and get you a higher-quality experience. USB compatibility also lets us easily support new third-party plug-and-play hardware capabilities in a similar capacity to current Tessel modules,” Kelsey Breseman adds.

Tessel 2 is currently available for pre-order with an estimated delivery set for August 2015. Want to delve deeper? You can head over to its official page here.

This blog originally appeared on Atmel Bits & Pieces.

No novice to DIY, Taylor Alexander has spent a life of hacking, making and transfiguring things to have them do all sorts of actions than these electronics were originally made to do. At the early age of five, he would break objects down and rebuild them to create something entirely different — taking parts from old cameras, stereos and other components, then transforming them into electric cars.

banner_sm.png

Born out of his own frustration as to how difficult it was to connect two Arduino boards wirelessly, the Maker went on to invent Flutter, which not only gained enormous popularity among the DIY crowd but garnered just over $150,000 on Kickstarter back in 2013. The $36 wireless Arduino with a half-mile range lets users develop mesh networking protocols and connected devices in an efficient yet inexpensive manner. It’s perfect for robotics, consumer electronics, wireless sensor networks, and educational platforms. Flutter is packed with a powerful Atmel | SMART SAM3S Cortex-M3 processor, while an ATSHA204 crypto engine keeps it protected from digital intruders. This enables Makers to easily (and securely) build projects that communicate across a house, neighborhood and beyond, including a 3D-printable remote control car named Scout.


flutter-1-1024x683.jpg

Scout is an experimental vehicle that can be constructed by anyone using a 3D printer with at least 165mm of travel in one axis. The original prototypes were printed using an Ultimaker 3D printer, a Maker-friendly machine which he highly recommends. Impressively, Scout doesn’t use any screws, and instead, simply snaps together using interlocking parts and clips. This allows the whole vehicle to be disassembled and reassembled in just a few minutes.

The current vehicle was crafted pretty quickly over the course of a few weekends as a mere proof-of-concept. What this means is that it admittedly comes with a few flaws, for the moment at least. However, the Maker does encourage his fellow Github community to share their input to help improve its design. Despite the flaws, which Alexander reveals below, the car is quite capable. So much so that it can even pull off 10-foot wheelies. How ‘bout that?!

scout-main-1024x683-1.jpg

A short list [of flaws include]: The right angle mounting of the motor creates a week point with the bevel gears. The wheels are supposed to slip on, but using my printer they need to be hammered into place with a mallet. The steering requires a piece of bent piano wire, and should be replaced with a printed linkage. The body shell easily comes off, and so tape should be wrapped around the body of the system. There is no hole in the body shell for a power switch, so without modification the tape needs to be cut to toggle power. After agressive driving the motor gets hot and eventually wiggles in its mount,” he writes.

Aside from the Flutter wireless ‘duino, the project consists of eight 608 Skate bearings, a metal gear servo, a brushless quadcopter motor, a quadrotor propeller adapter, four toy car tires, and of course, some batteries and other electronic components. To see how Alexander put these pieces together, well you’ll have to head over to his Github page here. In the meantime, you can see it in action below!

This blog originally appeared on Atmel Bits & Pieces.

I have finally caught up and this is the last aggregation of recent articles. From now on, all being well, I’ll post to alert readers of new material being available. This time the articles cover measuring RTOS performance, the use of open source tools, memory use optimization and approaches to debugging …

Why and how to measure your RTOS performance

In the world of smart phones and tablet PCs memory might be cheap, but in the more constrained universe of deeply embedded devices, it is still a precious resource. This is one of the many reasons why most 16- and 32-bit embedded designs rely on the services of a scalable real-time operating system (RTOS). An RTOS allows product designers to focus on the added value of their solution while delegating efficient resource (memory, peripheral, etc.) management. In addition to footprint advantages, an RTOS operates with a degree of determinism that is an essential requirement for a variety of embedded applications. This article takes a look at “typical” reported performance metrics for an RTOS in the embedded industry.

Embedded software development tools – a third way

What is so special about programming embedded software? More specifically, how does it differ from programming for desktop computers? Along with addressing these questions, this article looks at why there are so many options for embedded development tools – why such a wide choice? And what strategy makes sense for selecting them? Are free tools worth having or do you need to pay real money?

Optimizing data memory utilization

 

Bare Metal development environment.png

To read the rest of this entry, visit the Colin Walls blog via Mentor Embedded.

At the recent Embedded World show in Nuremberg running from 24th to 26th Feb 2015 we saw the first MCU offerings from ARM’s silicon partners based on the high performance Cortex-M7, which is the latest member of the ARM Cortex-M processor family.  The Cortex-M7 delivers impressive performance, > 5 Coremark/MHz and twice the compute power of the Cortex-M4, whilst maintaining the low latency and high energy-efficiency of the Cortex-M family. 


It has already won 3 awards: Best Processor IP from Linley, Low Power Design Innovation from the NMI, and the STM32 F7 (based on Cortex-M7) won the Best-in-Show Award – Best Hardware Product at the ARM Tech Con.


There was quite a buzz at the show around this new technology and a wide variety of application areas were being demonstrated including audio processing, IoT gateway functionality and advanced GUI interfaces. 

 

On the ARM booth we demonstrated the DSP capabilities which are built into the instruction set of the Cortex-M7, by running one demo to enhance dialog from a movie soundtrack and another demo to enhance the sound quality of a compressed audio stream.  These demos were run on STMicroelectronics’ Discovery Board with STM32 F7, based on the Cortex-M7 core.

 

I interviewed Paul Beckmann, CTO and Founder of DSP Concepts on the ARM booth, together with Fred Le Cam, Product Line Marketing Manager for STM32 F7, STMicroelectronics.



 

 

Atmel showed their recently launched SAM V70/V71, SAM E70 and SAM S70 MCUs based on the Cortex-M7 processor with floating point unit.  These exciting and innovative devices are targeted at automotive, IoT, medical and industrial applications.  The family is based on a platform with a 300MHz core integrated with 16kB of instruction cache, 16kB of data cache and up to 384kB of multi-port SRAM of which up to 256kB can be flexibly configured as tightly-coupled memory for deterministic, real-time access.

 

On the Atmel booth we saw demos run by Paul Beckmann from DSP Concepts, showing how the SAM V71 can use the high DSP performance of the Cortex-M7 to provide streaming audio across Ethernet AVB for use in audio systems in cars.  This demonstrated how the processing power of the Cortex-M7 can be coupled with an efficient Ethernet MAC to provide full Ethernet-AVB functionality.


The demo was running on a SAM V71 Xplained Ultra Evaluation Kit.

 

Richard York from ARM interviewed Lionel Perdigon, Product Marketing Manager, Atmel.





At the show, Freescale announced their family of Kinetis KV5x MCUs based on the Cortex-M7 core with single-precision floating point unit.  The KV5x provides a combination of robust connectivity, security and safety features, which make it particularly suitable for use in digital motor control and power conversion. 


It maximizes high performance and deterministic processing by embedding 128kB of data tightly-coupled memory (DTCM) and 64kB of instruction tightly-coupled memory (ITCM) for real-time response in a typical motor control application, further enhanced by the raw processing performance of the Cortex-M7 core which lies at its heart.

 

Richard York from ARM interviewed Steve Tateosian who is Freescale's Director of Microcontroller Platforms.





STMicroelectronics showcased their STM32 F7, which is also based on the powerful Cortex-M7 processor.  The STM32 F7 harnesses ST’s ART accelerator as well as using instruction and data caches to deliver impressive code performance whether a user’s code executes from Flash or from external memory.  The device has excellent power efficiency giving 7 Coremark/mW when running 180MHz and typically consuming 120uA when in Stop mode.

 

On the ST booth we saw how ST is helping the Internet of Things become a reality with a home gateway demonstration powered by the STM32 F7. The gateway included a graphical user interface from which the user can control and monitor usage of their utilities (water, gas, electricity etc.) with full connectivity throughout the house and to the outside world. The user was also able to download new functionality to the gateway via an online apps store. 


The demonstration showed how the power of the Cortex-M7 can be used to provide an easy-to-use graphical interface whilst performing a variety of data aggregation and analysis functions in the background.

 

Andy Frame from ARM interviewed Johan Pauvert, MCU Technical Marketing Manager, STMicroelectronics.




 

So we have seen the first exciting MCUs based on Cortex-M7, delivering high levels of performance to the MCU market, whilst still maintaining the power-efficient, low latency characteristics of the Cortex-M processor family.  I'm looking forward to seeing the consumer devices which this level of performance will enable, and the future processors coming from our lead partners and further licensees of the Cortex-M7.


ARM Connected Community Board Breakdown (2).png

Happy Monday folks! On Friday we announced the winners of the ST Nucleo boards! Congrats to all of the winners =). This week we have another great prototyping board brought to you by NXP: the LPC1768! You should understand why I find this board so exciting: I have had a box of the mbed Application boards on my desk for about a month now that I haven't been able to try due to a lack of LPC1768's. When you get to the review you'll see why it was so sad to stare at these boards without being able to use them. When I was finally bequeathed the LPC1768 I got to try them out together and they were so much fun as a package deal that this week's board giveaway is ONE LPC1768 with an application board!

How do you get your hands on this combo?* Comment below (here in the Connected Community) with how you would use this board for a chance to win! The winners will be announced by noon on Friday, March 20, 2015.

mbed_ada.PNG

Image courtesy of Adafruit.com


Hardware

From a design aspect I have needed to take the physical size of the board into account, what voltage supply/ battery pack to purchase, the number of break out pins available for sensors, price and available documentation. These aspects have therefore been noted in case they are important to anyone else’s design.

  • Physical dimensions (width x length)
    • Combined: 7cmx11cm
  • CPU specs: Performance, Memory, Power
    • Input voltage: 5V, 4.5-9V
    • Operating voltage: 5V
    • Flash memory: 512 KB Flash
    • RAM: 64 KB of SRAM
    • Clock speed: 96-100MHz
  • I/O specs:
    • LPC1768 (standalone)
      • 40 pin DIP
      • 1 x Ethernet
      • 1 x USB OTG
      • 2 x SPI
      • 2 x I2C
      • 3 x UART
      • 1 x CAN
      • 26 x GPIO
      • 6 x PWM
      • 6 x ADC
    • mbed Application board
      • 128x32 Graphics LCD
      • 5 way joystick
      • 2 x Potentiometers
      • 3.5mm Audio jack (Analog Out)
      • 3.5mm Audio jack (Analog In)
      • 1.3mm DC Jack input
      • Speaker, PWM Connected
      • 3 Axis +/1 1.5g Accelerometer
      • 2 x Servo motor headers
      • RGB LED (PWM connected)
      • USB-mini-B Connector
      • USB-A Connector
      • Temperature sensor
      • Socket for for Xbee (Zigbee) or RN-XV (Wifi)
      • RJ45 Ethernet connector

lpc1768.PNG

Courtesy of developer.mbed.org


Software

The benchmarking for software was determined by the available IDEs, native languages, time to get started and the like.

Projects & Community

Whenever you take on a new project it is always nice to see what other people have done. Therefore the last section is dedicated to the resources already available.

 

Opinion time:

What I appreciate about the LPC1768 and application board


First off I have used NXP's technology before and I love their documentation. The resources for this board are extensive and very useful when you are getting started, writing a driver, or when you are stuck in general. The application board adds a wide variety of peripherals that are great for prototyping different inputs all in a very compact space. On top of all this there is plenty of example code out there to get started with the board immediately. I could see this board as a teaching tool for those getting their feet wet with embedded programming and as a fast way to develop a proof of concept.

 

 

 

*Please be aware that if there is an export restriction you may not be eligible to receive the board. Please PM if you have any questions or concerns.

 

Warning on biases: I am a senior Computer Engineering student with a background in embedded systems. I have worked with a variety of ARM-based boards for projects over the years. I acknowledge that I have my own set of preferences based off of what has worked well in the past but I have tried to be as impartial as possible since not everyone has the same project goals.I am an intern at ARM but these opinions are my own. The donations aren't going to change my opinions- I don't get to personally keep them after the review. Instead they will be here at the ARM office in case any of our awesome Community members has a question that requires more than a dive into the schematics =). Finally, if you have had a different experience I welcome your feedback!

The Linux kernel provides an ARM PMU driver for counting events such as cycles, instructions, and cache metrics. My previous article covered how to access data from the PMU automatically within SoC Designer by enabling hardware profiling events. It also discussed how to enable access from a Linux application so the application can directly access the PMU information. This article covers how to use the ARM Linux PMU driver to gather performance information. In the previous article, the Linux application was accessing the PMU hardware directly using system control coprocessor instructions, but this time a device driver and a system call will be used. As before, I used a Carbon Performance Analysis Kit (CPAK) for a Cortex-A53 system running 64-bit Linux.

 

The steps covered are:

  • Configure Linux kernel for profiling
  • Confirm the device tree entry for the ARM PMU driver is included in the kernel
  • Insert system calls into the Linux application to access performance information


Kernel Configuration


The first step is to enable profiling in the Linux kernel. It’s not always easy to identify the minimal set of values to enable kernel features, but in this case I enabled “Kernel performance events and counters” which is found under “General setup" then under "Kernel Performance Events and Counters".


konfig-1a


I also enabled “Profiling support” on the “General setup” menu.


konfig-2a


Once these options are enabled recompile the kernel as usual by following the instructions provided in the CPAK.


Device Tree Entry


Below is the device tree entry for the PMU driver. All Carbon Linux CPAKs for Cortex-A53 and Cortex-A57 include this entry so no modification is needed. If you are working with your own Linux configuration confirm the pmu entry is present in the device tree.


pmu-dt-a


When the kernel boots the driver prints out a message:


hw perfevents: enabled with arm/armv8-pmuv3 PMU driver, 7 counters available


If this message is not in the kernel boot log check both the PMU driver device tree entry and the kernel configuration parameters listed above. If any of them are not correct the driver message will not appear.


Performance Information from a Linux Application


One way to get performance information from a Linux application is to use the perf_event_open system call. This system call does not have a glibc wrapper so it is called directly using syscall. Most of the available examples create a wrapper function, including the one shown in the manpage to make for easier usage.


perf-event-open-a 


The process is similar to many other Linux system call. First, get a file descriptor using open() and then use the file descriptor for other operations such as ioctl() and read().The perf_event_open system call uses a number of parameters to configure the events to be counted. Sticking with the simple case of instruction count, the perf_event_attr data structure needs to be filled in with the desired details.


It contains information about:

  •          Start enabled or disabled
  •          Trace child processes or not
  •          Include hypervisor activity or not
  •          Include kernel activity or not

 

Other system call arguments include which event to trace (such as instructions), the process id to trace, and which CPUs to trace on.

 

A setup function to count instructions could look like this:

 

perf-setup-a

 

At the end of the test or interesting section of code it’s easy to disable the instruction count and read the current value. In this code example, get_totaltime() uses a Linux timer to time the interesting work and this is combined with the instruction count from the PMU driver to print some metrics at the end of the test.

 

perf-final-a

 

Conclusion


The ARM PMU driver and perf_event_open system call provide a far more robust solution for accessing the ARM PMU from Linux applications. The driver takes care of all of the accounting, event counter overflow handling, and provides many flexible options for tracing.

 

For situations where tracing many events is required, it may be overly cumbersome to use the perf_event_open system call. One of the features of perf_event_open is the ability to use a group file descriptor to create groups of events with one group leader and other group members with all events being traced as a group. While all of this is possible it may be helpful to look at the perf command, which comes with the Linux kernel and provides the ability to control the counters for entire applications.

 

Jason Andrews


PubNub's Ian Jennings demonstrates how to connect your Arduino to a mobile cellular network with a GSM/GPRS shield.


There's a ton of tutorials out there on hooking your Arduino up to the LAN, whether it be Wi-Fi, an Ethernet, or other. But what about beyond the LAN? What if you want to connect your Arduino to the Internet in the wild? In this tutorial from PubNub’s Developer Evangelist Ian Jennings, we'll show you how to connect your Arduino to a mobile cellular network with a GSM/GPRS shield. This enables you to stream data bidirectionally or trigger device actions anywhere with a cellular network. And, that's powerful for any mobile IoT implementation (think connected car or drones) or apps without a Wi-Fi signal (think irrigation or weather sensor networks). Like like the many other DIY Arduino projects out there, it's easy, affordable, and powerful. So let's get the tutorial started!

arduino mobile cellular network

What You'll Need

 

  • Arduino UNO Rev3 (ATmega328)
  • Seeed Studio GPRS Shield V2.0
  • AT&T SIM Card (standalone)
  • C size batteries (x5)
  • C size battery holder (x5)
  • Smartphone
  • Laptop

Setting up the SIM Card


The first thing you'll need to do is unlock the SIM card and make sure it has a data plan associated with it (hence why we included the smartphone on the list above). Put the SIM card into your phone and read the instructions on the package.


In the case of an AT&T SIM card, you may have to dial a series of numbers to activate the card, then configure the plan online, but this may vary depending on the carrier. Note: Make sure your mobile plan supports data transfer and not just calls and texts.Then, connect to a website on your mobile phone. If it works, you have data and the SIM card will work on your Arduino.


Setting up Arduino GPRS

 

Plug in your now-activated SIM card to your Arduino GPRS Shield. For how to do this, Seeed Studio has a great tutorial. Follow the tutorial, but stop and come back to this tutorial before uploading code in "Test Setup."

 

 

Arduino Libraries

 

There are a fair amount of libraries needed to get setup on Arduino, but at the end, it'll make it all a lot easier. The specific libraries for the Seeed Studio GPRS Shield v2 can be found here. In the docs, you'll see the three libraries you'll need to connect to a mobile network. Import all three libraries into the Arduino setup.

Software Serial

 

Now that our shield and Arduino environment are ready, let's move onto the fun part of this tutorial: playing with the cell networks. We need a way to talk to the SIM900 chip on the Arduino. Instead of using a hardware serial and talking directly to it, we're going to use Arduino's software serial. Open up the SIM_900_Serial_Debug example from your Arduino examples folder.

 

 

This example is pretty simple. All we're doing it proxying the serial data from Arduino's serial port into SIM900's. This enables us to use the included Arduino serial debug tool to interact with our SIM900.

void loop(){   if(gprs.available()){     Serial.write(gprs.read());   }   if(Serial.available()){         gprs.write(Serial.read());   } } 

Call Yourself

 

To test everything out, we're going to attempt to call ourselves with the Arduino GSM shield. First, load the software serial example onto the Arduino and then open up the serial debugger. Be sure to power the SIM card on the Arduino GPRS shield using the button on the side. Power up the SIM900 by pressing the power button for around 2 seconds. The red LED will turn on. The green one beside it will begin blinking. If the shield joins the network successfully, the green LED will blink every 3 seconds. Wonderful!Make sure you put your old SMS card back into your phone after testing the Arduino SIM. Now, type the following into your Arduino serial window.

AT 

Serial output should show something like:

RDY +CFUN: 1 +CPIN: READY +PACSP: 0 Call Ready 

If you don't see the messages in the serial monitor, click the "send new" option that will add carriage return at the end of AT command, and then send AT command “AT+IPR=19200″ to set the baud rate of the SIM900. Now try calling yourself. Enter the following command, replacing 1***8675309with your own number.

ATD1***8675309; 

If it succeeds, a message ATH OK will show up as the picture below. Otherwise, No CARRIERwill show up instead. The reason might be nonexistent phone number or incorrect command format.

Connecting to the Mobile Cellular Network

 

Now that we've configured our Arduino to work over GSM, let's get it connected to the mobile cellular network. Make sure that the baud rate of SIM900 is 9600! You can use the AT Command(AT+IPR=9600) to set it through SerialDebug. Load up the the GPRS_TCPConnection example from GPRS_Shield_Suli. This example makes a simple request tombed.org/media/uploads/mbed_official/hello.txt HTTP/1.0\r\n\r\nHowever, it probably won’t run when you load it on your Arduino. This is because it’s not configured to work with your specific cellular network. In my case I’m using AT&T, so I needed to change the following lines to configure my GPRS connection:

GPRS gprs(PIN_TX, PIN_RX, BAUDRATE,"cmnet"); 

This line isn’t sufficient in most cases. We’ll also need to supply an APN, username, and password. These parameters are omitted from the example but you can simply supply them on your own. You can find the relevant code here.

GPRS(int tx, int rx, uint32_t baudRate = 9600, const char* apn = NULL, const char* userName = NULL, const char *passWord = NULL); 

To connect to AT&T, use the following config:

GPRS gprs(PIN_TX, PIN_RX, BAUDRATE, "wap.cingular", "WAP@CINGULARGPRS.COM", "CINGULAR1"); 

Now run the code. You should be able to obtain an IP and issue the request. However, the app will probably crash (SIM turns off) when the request has been issued. This might be confusing, but there’s an easy fix.

Battery Considerations

 

The Seeed Studio and a variety of other shields advertise to be “plug and play” with Arduino. However, this isn't always the case. This shield in particular doesn’t have enough power from the single 5v USB supply to successfully complete TCP requests. This is easy enough to fix though, all we need to do is give it more power! Online forums suggest adding 5 C-cell batteries to power the GSM chip, which is what we did below:

 

 

The batteries should be wired in series, with the positive end wired into the VIN input and negative wired into the GND. After you’ve added batteries, try the example again. It should connect successfully. Great! Now we’re ready to signal with PubNub.

 

Signaling with the PubNub Data Stream Network

 

We're going to use the PubNub Data Stream Network as our backend messaging layer for signaling our Arduino. This enables you to send and receive data bidirectionally between your Arduinos and signal to trigger device actions. Load the following example onto your Arduino, changing the GPRS gprs() configuration as mentioned previously.

#include 
  #include
  #include
  #include
#define PIN_TX 7 #define PIN_RX 8 //make sure that the baud rate of SIM900 is 9600! //you can use the AT Command(AT+IPR=9600) to set it through SerialDebug #define BAUDRATE 9600
GPRS gprs(PIN_TX, PIN_RX, BAUDRATE, "wap.cingular", "WAP@CINGULARGPRS.COM", "CINGULAR1");

  void publishData(String data) {
  Serial.println("attempting to publish");

  while (false == gprs.join()) {
  Serial.println("gprs join network error");
  delay(2000);
  }
  String str = "GET /publish/demo/demo/0/pubnub_gprs/0/\"" + data + "\" HTTP/1.0\r\n\r\n";

  // Length (with one extra character for the null terminator)
  int str_len = str.length() + 1;
  // Prepare the character array (the buffer)   char http_cmd[str_len];

  // Copy it over
  str.toCharArray(http_cmd, str_len);
  char buffer[512];

  if (false == gprs.connect(TCP, "pubsub.pubnub.com", 80)) {
  Serial.println("connect error");
  } else {
  Serial.println("publish success");
  Serial.println(data);
  }
  gprs.send(http_cmd, sizeof(http_cmd) - 1);

  gprs.close();
}

  int counter = 0;
void setup() {

  Serial.println("starting");
  Serial.begin(9600);   // use DHCP   gprs.init();   // attempt DHCP

  while(true){
  publishData(String(counter));
  counter++;
  delay(1000);
  }
  gprs.disconnect();

  }
  }
void loop() {

 

This example connects to PubNub and publishes a message every second. It works just like the previous example, but instead of retrieving data, this example streams information to the PubNub network where it’s accessible from anywhere.

Rest Client

 

You can see how the message is assembled by looking at the publishData() function. See how the url is created here:

String str = "GET /publish/demo/demo/0/pubnub_gprs/0/\"" + data + "\" HTTP/1.0\r\n\r\n"; 

It may be confusing at first, but let’s break it down. The url is formatted according to the PubNub REST Push API.

http://pubsub.pubnub.com /publish /pub-key /sub-key /signature /channel /callback /message 

The domain pubsub.pubnub.com is defined later in the function. The publish key refers to is the pubnub command (you can also subscribe). The pub-key and sub-key come from your own PubNub account, but you can use thedemo keys for now. Don’t worry about signature. The channel is really important. This is like an IRC channel for your PubNub devices to talk to each other.

 

Show Me the Data

 

Since we don’t have any other device listening for messages from the Arduino, let’s use the PubNub console to observe our channel activity. If you’re using the default code above, you can use this link to view channel activity for your GPRS chip. If your demo is running you should see a count like 1, 2, 3, 4 appear in the “message” pane.

 

We’re able to view the data coming out of the Arduino because we plugged the same publish and subscribe key into the PubNub console as we did into the Arduino. Since we’re using the demo keys the channel is shared publicly, but if you create your own account your data will be privatized.

https://github.com/pubnub/pubnub-evangelist-blog-posts/blob/master/Ian-Arduino-GSM.md#more-info

Additional Resources and More Information


This is just one of our many Arduino-PubNub implementations. We’ve also connected Arduino Yún to the Internet, as well as showing you how to connect Arduino Uno and Seeed Studio Ethernet Shield v2. For all our Arduino related posts, here’s the full feed.


Ian Jennings is a developer evangelist at PubNub, a secure global data stream network for IoT, mobile, and web applications. He cofounded Hacker League, a site devoted to simplifying the organization of intensely collaborative tech events known as "hackathons." Jennings recently pretty much guaranteed that he'll always be able to keep himself stocked up on techno-gadgets with the sale of Hacker League to Intel's Mashery subdivision for the price of more than a few PCs. But he's not done. In fact, his latest invention, Mote.io, is a remote that connects your web browser with various music platforms like Pandora, Youtube, and Rdio, and has gotten raves on tech sites like GigaOM; he’s also in the midst of developing the Reddit app for the uber-hyped tech accessory Google Glass.

New York City-based startup ThingsOnInternet has launched a Kickstarter campaign for their new easy-to-use development suite for interactive Internet of Things (IoT) designs. As its name implies,VIPER — or “Viper Is Python Embedded in Real-time” — makes it possible for Makers and embedded designers to create their next connected project in Python for Arduino, UDOO and Spark, all in in real-time. And, unlike other solutions that already exist today, this collection of products is platform-agnostic and compatible with all sensors and kits

photo-1024x768-11.jpg

The idea was first conceived after conducting some detailed market analysis, where the company discovered that designers, Makers and programmers all faced similar set of challenges. In hopes of simplifying how “things” are brought onto the Internet, VIPER converged a series of components to better streamline the process. This included an IDE to manage and program the boards, a Virtual Machine to serve as its operating system, a plug-and-play TOI Shield, an extensive library of ready-to-use functions, and a mobile app to act as the interface for smart objects. On top of that, it’s also cloud-ready. With just a little coding, users can develop a wide-range of IoT applications, ranging from interactive storefronts, to home and industrial automation, to art and museum installations, to smart farming.

arduino-shield1.jpg

“Designers aim to create behaviors that can co-exist at the same time and they are often frustrated by ‘anomalous’ and unexpected results on their projects. Makers, who have higher competences, invest a lot of time in understanding how to code multithreaded behaviors, how to manage interrupts in C++, etc. and sometimes their code become really hard to be maintained. Programmers are frustrated by executing ‘boring’ tasks for their customers, one of them is related (again) to multithread, interrupts, callbacks, timers and exceptions,” ThingsOnInternet writes.

Since millions of developers already know Python, VIPER decided to make the programming language readily accessible for commercial interactive products as well, therefore amplifying the potential for smart objects to be as pervasive as mobile devices in their ease of design interactivity. To do this, VIPER provides a browser-based, minimal-installation development environment where users can write code with extensive library support and have it executed on any Arduino-like board. What’s great for designers is that, with VIPER, it leaves them able to focus on the features and functionality, not the tediousness, along with a mobile app to control their creation for free.

arduino-shield.jpg

“Devices like Arduino, UDOO, ST Nucleo, Spark Core, Photon and the last released Spark Electron are microcontroller boards that revolutionized the world of amateur and semiprofessional electronics. They allowed hundreds of thousands of people around the world to give objects a new life by making them interactive, able to communicate and interact with humans,” the team explains. “Unfortunately, programming them is quite easy for engineers and computer scientists, while most of the users are able to exploit only part of the huge potential of such incredible boards. Here comes the idea of TOI to extend the world of smart and interactive object design to everyone. VIPER allows in a few clicks to convert a common lamp in a smart assistant that reminds us to take the umbrella, turn on the air conditioning while monitoring the house for intrusions.”

In order to use the suite, Makers and developers simply download a one-time package from the company’s website onto either their PC or USB stick. Beyond that, VIPER includes an embedded, portable Python 3.0 engine in order to make life easier. Users can then launch the VIPER IDE and begin making. All that’s left from there is connecting its accompanying mobile app to serve as the UI for the project.

someshield.jpg

VIPER runs on an Arduino Due (SAM3X8E), and can even be ported onto the recently-revealedAtmel | SMART Cortex-M7 family. As its creators reveal, code developed on an Arduino Due can also be executed onto these new MCUs in a matter of two clicks. Furthermore, the suite features an Arduino and Spark Proton-compatible, plug-and-play TOI shield. Simply attach either a Due or Photon to the shield and start playing with any of the VIPER examples found in its library. (This collection of modules includes CC3000 Wi-Fi for Spark Core and Adafruit Shield, Adafruit/Sparkfun Thermal Printer, Adafruit NeoPixel LED, RTTTL smart melody player, Streams library, as well as TCP and UDP network protocols.) Aux ports are even included, enabling the use of other sensors like Grove, ThinkerKit, Phidgets, and Adafruit NeoPixel LED strips.

Through its IDE, users can ‘viperize’ theirs boards by installing them using the VIPER Virtual Machine. Once completed, a board is no longer a simple Arduino Due, Spark Photon or UDOO; instead, it has a multi-threaded, real-time operating system running on it, and a virtual machine ready to execute compiled Python 3 scripts. Ready to design your next smart project? You’ll want to check out its official Kickstarter campaign, where the team is currently seeking $20,000.

This blog originally appeared on Atmel Bits & Pieces.

Although the theme of EW was Internet of Things, there was so much to see at Embedded World (EW).  I was impressed with the breadth of embedded computing technologies.   If you are interested in my morning EW adventures, please check out my first Embedded World blog.  My next journey was to check out some of the Partners at EW over Tuesday afternoon and Wednesday morning.  Given the very full 5 halls, I couldn’t cover too much!

 

Starting at the smallest #MCU, Atmel announced ATSAMDA01 a new family of ARM Cortex-M0+ devices focused on the automotive Atmel DA1 M0+.JPGsegment, including in-car HMI.  It is the first automotive-qualified product family.  Artie Beavis shares more in his blog Atmel launches automotive grade ARM Cortex-M0+-based MCUs.

 

Moving to high performance MCUs, Atmel also demoed their SAM S70 and E70 based on the Cortex-M7. It’s reached 1500 CoreMarks, 645 DMIPS at 300 MHz.  It has up to 2 Mbyte of Flash with extensive high-speed communication links.  Learn more from the video with Atmel below.

 

Atmel's Application Bases Featuring ARM Cortex-M7 (EMB 2015) - YouTube

 

The Cortex-M7 is highly versatile and can be configured to meet the needs of many different markets.  Freescale new KV5x MCU family is focused on motor control and power conversion applications.  Freescale shared in this video the family's processing performance and its dedicated peripherals.

 

Freescale Kinetis KV5 Family (EMB 2015) - YouTube


Single Board Computing (SBC) continues to gain momentum.  Freescale also announced the new i.MX 6SoloX based on both the Cortex-A9 and the Cortex-M4.  The flexibility of the two cores allows the Cortex-M4 to run an RTOS while the Cortex-A9 runs Linux.  Both cores communicate with each other but since they don’t share the same OS, it makes for a convenient, flexible and secure environment.  This video shares more about some of the supporting Freescale ecosystem and board vendors.

1423770108534[1].png


Perhaps one of the best examples of the breadth of ARM technology in one system, Xilinx announced their UltraScale+ MPSoC family of FPGAs.
As this block diagram demonstrates, this family has four Cortex-A53 processors, two Cortex-R5 processors and an ARM Mali-400 GPU.  There was a very compelling demo showing real-time video processing.  The system also supports Android.  A whole lot of ARM IP love in 64-bit.  Gain more insights from the video below.

 

Xilinx Zynq UltraScale+ MPSoC (EMB 20105) - YouTube

 

It was quite an experience for me for my first Embedded World.  I thought it felt really busy and EW’s numbers prove it – all-time highs for the show.  While I expected the focus on IoT, I was really excited to see the breadth of ARM technology at the show from the lowest power MCU to a high-performance 64-bit system.

 

Looking for more about ARM at Embedded World?  Review my tweets @lorikate and the ARM Embedded World video playlist.

 

Stay tuned as this week I’m at MWC 2015.  No rest for the weary!

Each Fall, just before the weather becomes too horrible, I get to attend ECS [Embedded Conference Scandinavia] in Stockholm, Sweden. It has become a good event for embedded developers in that area and I am pleased that my paper submissions seem to result in a couple of acceptances each year.

This year, I assume ECS will be in 6 months or so, but the organizers are inaugurating a new event …

Next week [10/11 March] is ECS Syd [“syd” is Swedish for south], which is being held in Malmö in southern Sweden. This is an area where there is quite a good start-up culture, so it should be an interesting environment.

I submitted some proposals and was pleased to receive two acceptances. Then, another speaker canceled and the organizers kindly offered me a further slot, so now I have 3 sessions:

Dynamic Memory Allocation & Fragmentation in C & C++

In C and C++, it can be very convenient to allocate and de-allocate blocks of memory as and when needed. This is certainly standard practice in both languages and almost unavoidable in C++. However, the handling of such dynamic memory can be problematic and inefficient. For desktop applications, where memory is freely available, these difficulties can be ignored. For embedded – generally real time – applications, ignoring the issues is not an option.
Dynamic memory allocation tends to be non-deterministic; the time taken to allocate memory may not be predictable and the memory pool may become fragmented, resulting in unexpected allocation failures. In this session the problems will be outlined in detail and an approach to deterministic dynamic memory allocation detailed.

Power Management in Embedded Systems

To read the rest of this entry, visit the Colin Walls blog via Mentor Embedded.

stack overflow.png

Filter Blog

By date:
By tag: