element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Upcycle It
  • Challenges & Projects
  • Design Challenges
  • Upcycle It
  • More
  • Cancel
Upcycle It
Blog [Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #6: Changing the Display
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: konstantinoskonstas
  • Date Created: 3 May 2017 12:09 AM Date Created
  • Views 1089 views
  • Likes 3 likes
  • Comments 4 comments
  • web sdr
  • upcycled_sdr
  • display change
Related
Recommended

[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #6: Changing the Display

konstantinoskonstas
konstantinoskonstas
3 May 2017

A change of plan.

 

I said to start writing early this week as my time limits according to my plan were over for trying to make the Nokia 5110 LCD work with node.js using MRAA initialization.

 

Some days ago, I wrote as a comment about the code that I could also try for this purpose.

The idea came from Andy who so kindly pointed to the js code for using the Nokia 5110 LCD with its Philips PCD8544 controller under javascript for the Beaglebone.

Τhat code (https://github.com/kkeller/Nokia5110) could easily converted for Edison Arduino board. The IO pins and b.functions for Beaglebone were substituted as well as the call to bonescript (var b = require('bonescript');) changed to MRAA (var m = require('mraa'); ).

It was our logical conclusion.

I tried running the modified files under node.js but I did not get any results on the LCD, so I started debugging and looking for possible issues from my modification.

From the results that I got I was under the impression that SPI was not set properly. So I decided to put the results of my test code as a comment on my previous post #5.

 

I then started to look at various documentation concerning MRAA and how SPI could be initialized and properly used, seeking some examples, especially under javascript. 

Although not in js, I considered the following initialize procedure as a typical complete example:

mraa_spi_context spi = mraa_spi_init(0);
mraa_spi_mode(spi, MRAA_SPI_MODE0 );
mraa_spi_frequency(spi,1000000);
mraa_spi_lsbmode(spi, 0)
mraa_spi_bit_per_word(spi,8);

and started to think that I should make it my guide in order to include the equivalent of it in js on the code that I was testing for Nokia 5110.

I then studied from the following link: https://iotdk.intel.com/docs/master/mraa/node/classes/spi.html#method_Spi

the MRAA API Classes and in particular the SPI Class, but it was yet not clear to me as a newcomer to javascript that that the described method was enough to initialize the SPI on the Edison Arduino board, so I went into further searching about examples and I eventually run up into the Sparkfun OLED through the link https://www.npmjs.com/package/edison-oled which had quite interesting information about connecting a display through SPI to the Edison.

I went through the code and the wrapper for some time and then as time was starting to leave me behind my scheduled plan I decided that I had better stop my debugging and move towards another direction.

 

I evaluated again my alternative options for the use of displays for the project.

Plan B was the Grove 16 characters by 2 lines display that came with the Edison pack and Plan C was to use the Sparkfun OLED together with the Sparkfun Base board that would make the hardware for the project a matter of simply connecting the power to the system.

It had an extra cost as I would have to buy extra boards, but again I evaluated the pros and cons and eventually made up my mind to go that way, so last Saturday I placed my order for the two boards, so that I could have them within this week. Meanwhile I could prepare the code.

Hardware-wise, I would simply have to remove the Edison core board from the Intel breadboard and simply snap it to the Sparkfun board from the one side, while from the other side I would snap the OLED board. Just soldering the 2 pin power header in one of the boards and that is all.

image

The OLED block included a small joystick and a pair of push-buttons, so that would enable me adequately to implement the control of my SDR Client without soldering anything else.

The up and down movements of the joystick can be used to change the frequency and the two buttons for the Band and the Mode change, while the button incorporated with the joystick could be used for the Step change. As the monochrome OLED is 64 x 48 it does not differ much from my Nokia LCD that is 84 x 48. Moreover its graphics capabilities can be used at least to provide two different size fonts. A bigger one for the frequency and a smaller one for the control of the functions.

The OLED display is of course only 0.66” (diagonally) compared to the approx. 1” of the Nokia LCD, but I end up with an Upcycle module with the smallest possible footprint, so it fulfills one of my other major goals which is the overall size of the modification module that will be “planted” in my receiver! Despite its smaller size, I am sure it will fit nicely 3 lines with small font data and 1 line with large font data and being a white on black OLEM will glow nicely at night.

The schematic of the OLED block can be looked over here: https://cdn.sparkfun.com/datasheets/Dev/Edison/oled_block.pdf . One extra bit of warning. Sparkfun does not use exactly the same pins that I did to connect Nokia 5110 on the Edison Arduino, as the product is intended to be used with the company's Block system that is stackable on the Edison core module.

image

I then went on and installed through the npm (node package manager) the edison-oled repository that inclued the code plus a number of examples that will make my project development move faster.

I simply executed the command

$ npm install edison-oled

and it installed without problems.

I then went the “tests” folder and through the examples as well as the wrapper code to get an idea of how I should work from now on.

The Sparkfun Base Block (https://www.sparkfun.com/products/13045) on the other side will provide the necessary USB port that will enable me to connect the Audio USB card that will drive the audio of my Receiver and will inter-connect Edison with the OLED and Controls Block.

 

Having said that, I start as of today preparing my js code for the project with a quick redesign of the operational functions and controls to match the needs of the new hardware.

At the same time, I will keep as a background task of my bedtime the possibility to make the Nokia LCD eventually work with Edison Arduino under Node.js with MRAA as I had originally thought. I hope that using the OLED and going through its code may prove helpful for me in doing so.

I do put here part of the initialization code that it is being used by Sparkfun and was mentioned previously, as I believe it is very informative about the way that a Display driver should interact with the SPI and it may be useful to more people. Please be aware that it has simply been copy-pasted for that purpose and should be read as a guidline only. It is not full code..

 

var edison = require('edison-oled');

//setup pins needed for SPI

var cspin = new edison.Gpio(111, edison.OUTPUT, edison.HIGH); //chip select  --> edison_oled.c code uses 111 mraa uses 9

var dcpin = new edison.Gpio(14, edison.OUTPUT, edison.HIGH); //data/command --> edison_oled.c code uses 14 mraa uses 36

var rstpin = new edison.Gpio(15, edison.OUTPUT, edison.HIGH); //reset --> edison_oled.c code uses 15 mraa uses 48

var sclkpin = new edison.Gpio(109, edison.SPI, edison.HIGH); //sclk --> edison_oled.c code uses 109 mraa uses 10

var mosipin = new edison.Gpio(115, edison.SPI, edison.HIGH); //mosi --> edison_oled.c code uses 115 mraa uses 11

var misopin = new edison.Gpio(114, edison.SPI, edison.HIGH); //miso --> edison_oled.c code uses 114 mraa uses 24

 

//create spi

var spi = new edison.Spi(edison.SPI_MODE_0, 10000000, false, cspin);

 

//reset screen

rstpin.pinWrite(edison.HIGH);

//should add a wait time here for a few milliseconds

rstpin.pinWrite(edison.LOW);

//should add a wait time here for a few milliseconds

rstpin.pinWrite(edison.HIGH);

   

//send commands to OLED

dcpin.pinWrite(edison.LOW); // DC pin LOW

spi.transferData(edison.DISPLAYOFF);

spi.transferData(edison.SETDISPLAYCLOCKDIV);

spi.transferData(0x80);

   

//send data to OLED

dcpin.pinWrite(edison.HIGH); //DC pin HIGH

spi.transferData(0xFF);

 

That is all for the time being. Next time I hope to be able to introduce the new design.

 

 

Published Posts
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #1: Introduction
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #2: Software Concept
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #3: Meeting with Edison
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #4: Software Challenges with Edison
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #5: The Software Challenge goes on
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #6: Changing the Display
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #7: Hardware is ready!
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #8: Problem with Audio.
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #9: Problem with Browser
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #10: Making the Web SDR Client work!
[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #11: One of its kind!
  • Sign in to reply

Top Comments

  • Workshopshed
    Workshopshed over 8 years ago +1
    It's easy end up spending hours on getting drivers etc to work. Looks like you've got a good display now for your radio.
  • DAB
    DAB over 8 years ago +1
    Every design needs a plan B. It looks like you can make good progress for the challenge. You can always go back to the Nokia display later. DAB
  • wuckertrhea
    wuckertrhea over 2 years ago

    It's simple to spend hours getting drivers and other people to work. It seems like your radio now has a nice display.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 8 years ago

    Every design needs a plan B.

     

    It looks like you can make good progress for the challenge.

     

    You can always go back to the Nokia display later.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 8 years ago

    It's easy end up spending hours on getting drivers etc to work. Looks like you've got a good display now for your radio.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 8 years ago

    Wise advice and good decision making.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube