Indecisions

Side Project:

I played with the OLED display this week. With the data I have on the display that makes any sense, it should be working.  I received sample code from the distributor I bought the display from.  I modified it to work on arduino, and still no display.  I may have damaged my display while probing the signals.  I shorted Vdd to Vcc with my scope probe.  I saw a little spark and I was no longer getting 13 Volts on Vcc

Included with the sample code is a schematic that has a drop down voltage regulator on it to drive Vcc.  The drop down voltage regulator is configured to regulate to 6 Volts. However, the input to the drop down regulator is Vdd. According to the SSD1332 data sheet, Vdd should not exceed 3.6 Volts.  This suggests that I have incomplete information.  The datasheet also says that Vcc should be between 7 and 20 Volts.

I am thinking I will disable the switching regulator and do further testing while sending individual commands.  I think I might try one of the 8 bit interfaces to see if I can write to and read from RAM. That will confirm the data interface is wired correctly.

Port Expander vs Level Shifter:

Continue reading

Refactoring Electronics (Hardware V00K)

Side Project:

I still haven’t gotten the OLED display working.  I am beginning to question Pinouts and even if the driver IC listed by the seller(s) is correct.  At this point I can’t even tell if the device is seeing my commands. I checked the board for shorts/solder bridges and even replaced the OLED display. I still can’t get anything to show up on the display.

I think a reasonable test would be to measure current to the display and send it a power on command.  If I am sending commands correctly, I should see a change in current draw.  After that, I will try working through the commands available in the datasheet for a SSD1332 chip looking for a change in the display or the current draw.

Refactoring:

Just like refactoring the code, It’s time to refactor the electronics design.  I checked on my feature request on the Espressif forum. Nothing new has happened.  So I am considering adding an external ADC to measure voltages.

Planning and Research:

Continue reading

Successful Test

Side Project:

I got the parts to build the OLED breakout PCB this week. I got them assembled and connected to my test STM32 Arduino device. Unfortunately, I didn’t get anything to show up on the display.  I did measure the 13.8 volts on the high voltage part of the circuit. (I wasn’t sure if the inductor I chose for this voltage could handle the current. I am still not sure)

The STM board got hot quickly when trying to drive the OLED. This leads me to believe that the OLED is drawing too much current.  I expect this display to work as well as the test display I have been using. It should draw about the same amount of current. My first guess is I have a solder bridge somewhere on the PCB.

Research:

I created a C project with multiple files and it worked without any problems. So I did a little  research and found that when I add C into a C++ project I need to tell the compiler which functions are written in C.  I found that I can wrap the #include in an extern “C”{} declaration.

Still Looking for a Fail:

Continue reading

Multi File Failure

Side Project:

I received the OLED breakout PCBs from OHSpark this week #SSD1332Breakout. I also received some of the parts to build it with.  I am hoping to have a working OLED by the end of this next week.  I will start with it in SPI mode to use existing code that I know works.  Then I will have to migrate the library to use 8 bit parallel interface mode.

I have decided to move forward with the STM32F103 as the microcontroller for the Arduino Compass Toy.  The microchip part is still a possibility if the STM32 chip doesn’t work out.

The Challenge:

I posted an Arduino programming challenge to the Arduino.cc community on Google+ and to twitter this week.

The challenge is to make a blink sketch that has nothing in it’s loop().

This is a just for fun challenge. The only requirements are that the LED blinks and loop() is empty.

I ask that submissions are made on February 22nd 2017 tagged with #ArduinoEmptyLoopChallenge

Click here to see the Google+ post.

Adventures in TDD:

Continue reading

Unit Testing

TDD/Unit Testing:

I searched some for TDD tutorials this week. and found a few. Unfortunately, I found tutorials with no or very little “hands on” practice.  So I am still looking for good tutorials.  When I find some, I will post links on this blog.

What I have gleaned from the tutorials so far is that when building your code, you replace your main file with your testing file(s) so that the tests can call each of the functions/methods individually with known values and should get back predictable results.

Embedded Units Testing:

For embedded systems unit testing, my code will be compiled to run natively on the development machine rather than being compiled for the target processor.  This means a different tool chain for test build than for production or debug builds.

Note: Tool Chain is the set of tools that are used to create machine runnable code from your source files.

Any API call or peripheral device needs to have mock code that can be run as part of the tests.

Note: Mock Code is software that represents things that are not on your testing machine, or would hinder testing.

“Hello World”:

Continue reading

Refactoring

Update:

No new information on the ADC feature request on Espressif”s forums.

Side Project:

I have started layout of the SSD1332 Breakout PCB.  I finished the layout and ordered PCBs from OSHPark.  Based on the datasheet for the SSD1332, I can get significantly better performance by using it in one of the 8 bit bus modes.  Someone suggested that I look at STM32 processors to drive the display with.  I will be considering that option this week.

Better Firmware:

Continue reading

Design Decision

Side Project:

I am moving forward with the Compass toy prototyping.  I am designing a simple breakout PCB for testing the display. I may put the display breakout for sale on Tindie.

Project Intent:

The primary goal of this project/blog is to show electronics design start to finish.

The design goal is an inexpensive in circuit chip programmer that will work for most devices available.

Options:

The Raspberry Pi Zero was released November of 2015 at a price of $5 US each.  I even got one with a copy of MagPi.  To Make it run any code at all, it needs a power supply and microSD card.

Of course I could continue with the current design.

Common components:

Both the Raspberry Pi and the current design need the following components.

Printed Circuit Board
Battery for power supply and charging circuit
Vpp Supply
Level Shifter Circuit
External ADC(Still undecided for current design)
USB to serial Bridge (not sure it’s necessary for R Pi)

Additional components for Raspberry Pi:

Continue reading

Level Shifter Research

Update:

My ADC feature request on Espressif’s BBS has had 118 views. Unfortunately no word from the developers.  This might mean I have to add an ADC chip to the design.

The problem:

I’ve been thinking about the level shifter and why it was causing my software to crash. 10M Ohm and 10pF capacitance are very small loads. The software crashing just because a scope probe is connecting is very bad.(stating the obvious)

The hypothesis:

Bidirectional level shifters are typically designed to react quickly to transitions and drive very weakly in the steady state. With the target pins unconnected the shifter is steady state and the scope probe might be enough to cause a problem.

The Experiment:

Continue reading

Motivation

Update:

I have received a reply on the Espressif forum that gives a few suggestions.  The suggestions did get me thinking about the problem in a new way, I’ll see where this leads.

Moving Forward:

I have not been very motivated to work on this project.  The lack of feedback makes me wonder if anybody is getting any value out of what I write.  I have been very busy in my Embedded systems consulting business. I have worked on it for over two years now.  I feel like I have hit two significant roadblocks.

I have decided to fight this lack of motivation.  There are a few things I do when I am struggling with motivation.  There is a song by Martina McBride called “Anyway”, I like to play it when I am feeling discouraged.  I also saw a couple of Ted talks by Brene’ Brown about vulnerability and shame that I like to revisit.  They remind me that the risks I take in putting my work out to the world have intrinsic value.

Vulnerability is the birthplace of innovation creativity and change. — Brene’ Brown

Man in the Arena

The Roadblocks:

Continue reading

Scope Probe loading

Merry Christmas and Happy New Year.  I hope your holidays are filled with friends and of course blinky things.

Update:

I posted on Espressif’s forum under bugs for a feature request. At the time that I write this post, there have been 26 views of the request.  I hope it gets enough interest that Espressif considers my request.

Testing:

I soldered a 2 pin header into pins 1 and 2 of the programming connector. I then connected 3.3 Volts to Pin1.  I hooked up my Oscilloscope to pin 4 and immediately saw data on the line.  Pin 4 is attached to MISO.  This is great news, the data is getting through the level shifter.  Unfortunately, the waveform shows a lot of noise.  Then I switched to 5V and I saw data again, but the firmware crashed very quickly.  I started out by assuming the 5 Volts was the problem. So I tried setting it back to 3.3 Volts and the system wouldn’t reboot.  Then I disconnected the voltage supply and still not booting.  Finally, I disconnected my oscilloscope probe and it would boot again.

Analysis:

The MISO line brings the code from flash into the processor. Any glitch on it could cause crashes/failures.  It appears that the scope probe added to the output of the chip was enough to cause a glitch back on the MISO line.  This is disappointing, scope probes are very minimal loads.  Typically 10pF and 10MΩ on the circuit.  That is less than most devices that I would want to program.  This is going to take some more time to look at.  I need to test with a larger load, and maybe some pullups/pulldowns.  I am beginning to think a port expander might be a better choice. It’s still early to make that decision.

Holidays:

Continue reading