HNTE

Bread & Butter : 07

Posted by HNTE May 27, 2012

May 28th : Home Sweet Home

OK so I did not end up getting the super productive week that I had hoped, I was sent to the middle of the desert in WA for work instead.
But I am back in the real world again now so let me try and remember where I was up to.

 

Launchpad Mini

So as part of my clever containers I designed a mini launchpad board sporting the MSP430G2553. I managed to fab it up using the toner transfer method, this is by far the smallest board I have made with this method, it is not the neatest soldering job but it works a treat..

I did have quite a bit of trouble initially actually, I very stupidly soldered a 47Ohm rather than a 47kOhm as the reset pullup resistor, I wont tell you how long it took me to find this mistake..

 

brd.JPG

 

brds.JPG

 

Bread & Butter : 08

Another delivery this week, this time from ebay. After finding I had the wrong kind of stepper motors in stock, I acquired a spare from ebay, this time a unipolar one. Excellent, one problem however, what is on the datasheet isn't translating to real life. The motor (Shinano Kenshi STP-58D211-02) has 6 wires, orange, black, brown, yellow, white, red with white and black being common. The other four being A, /A, B, /B.Now, regardless of how it is wired to the DDRV8805, the motor will simply not turn, it will lock in place and try to move, but nothing more. Anyone know of how these wires translate to the OUT1, OUT2, OUT3, OUT4 on the EVM?

 

Meanwhile, time to push on with the other components. First stop is the ZigBee kit. The sample code for this tool is quite comprehensive, lacking in documentation in a few places or just inconsistent between files, but otherwise good. It provides a good API for handling the ZigBee network as well as covering a few basics of the GPIO for the kit (Something the CC3000 didn't seem to do). If you are planning on using this as an introduction to ZigBee, do a bit of reading first to get your head around the way it is setup and to familiarise yourself with some of the terms used. A few of the terms can be slightly misleading at first (ClusterID for example), but once you go through it, they become clear.

 

I have one gripe about this kit though, and that is the size of the parts. While small is good and reduces cost, it feels like a little bit of mishandling is likely to destroy the headers connecting the battery pack or the programmer to the device itself. On the plus side, the pads for the device are broken out, at least the main ones for you. If you are planning on adding things to the kit and not just adapting messages etc, what looks like all of Port 2 is l for you, just be careful with spreading the load with those headers however. The available port means I might have to get creative with the communication between the WiFi portion and the ZigBee portion. If a UART or similar isn't available, something of a paralell interface may be required. This may limit the number of possible end points in this version, but given the number actually available this is not a huge issue. Future versions using their own PCB would make this easier giving the chance to break out and relevant serial pins.

 

Meanwhile, off to set up another repo for these parts and do some research into generating a suitable PWM signal for the lighting and motor.

COMPACT

Project "code name" Part 013

Posted by COMPACT May 23, 2012
24th May

"Vacation here I come!!"

web deer mouth open.jpg

I am just about to commence a two week holiday and unfortunately my motor control development kit and LCD displays have not arrived.

This means that I will also have to work without access to my laboratory and travel light leaving the main prototypes behind to prevent them from being damaged.

And that their completion will occur on my return.

(If you haven't guessed yet, the toy is the mystery object from previous installments.)

web deer setup.jpg

However I will take subset of components with me enabling me to continue code development.

Hopefully the missing items will have arrived on my return in two weeks to be integrated into the project.

 

I could have called this project "Borg" because "Resistance is futile".

 

 

THE PROJECT DETAILS

Project "code name" is the application of the Texas Instruments SimpleLink Wi-Fi CC3000 Module and MSP430FRAM5739 microcontroller to every day domestic items to automate them and making them accessible from the Internet whilst retaining their original functionality. To make full use of the WiFi module, the unwired portability is a very high priority as this enables the devices to be located anywhere within the range of a suitable access point.

Texas Instruments have created examples of this including a Crock Pot controlled from an Android phone but I am not sure whether the original Crockpot remained unaltered.

http://www.youtube.com/watch?v=vSad4V5c2QY

 

Many domestic items have some element of power, motor control or lighting control and sensors. Where possible I have made use of their existing circuitry to keep their original functionality intact.

This required the reverse engineering of these items.

 

The SimpleLink WI-Fi CC3000 Module and MSP430FRAM5739 can be used for sustainable technologies by breathing new life into obselete items. An obselete digital handset was used to demonstrate this point.

Rather that destroying a device for its raw elements, functional components have been extracted for reuse.

Reuse is considerably more environmentally friendly that recycling as it does not require the energy to transport it, destroy it make make something new of it.

 

To enact the marriage of the SimpleLink and MSP430FRAM5739 to domestic items EAGLE CAD was used to create schematic diagrams and PCBs.

Code Composer was used to develop the software with MSP430ware expediting development with its good examples.

 

In most cases interfacing to domestic items only required very simple circuits such as relays, drivers, current amplifiers standard audio analog signals and digital signals.

I have deliberately used a simplistic approach to prove how simple it is to create a vast array of applications.

 

The project actually consists of an array of items;

     1. Animated Speaking Toy that displays Twitter messages and can send status tweets back.

     2. Internet enabled vending machine

     3. Internet enabled Laser Animated Display

     4. Patient Health monitor.

     5. Weight change sensor

     6. Complete Home Automation system with full motor control for devices such as HVAC dampers, and full light control.

 

Each of which demonstrate the enhanced usefulness by their wireless and Internet integration.

 

Since I only have one two CC3000 modules, I need to dissemble one project to work on another.

This is not too difficult an issue especially with the FRAM being quickly reprogrammable and all.

Ideally all could be enhanced independently and simultaneously.

 

Animated Toy Details

To meet the quirky aspect of the competition, it seemed to me to include a funny toy in the entry.

The plan is to have the toy both convert text to speech and lip sync incoming twitter messages.

This combines the SimpleLink Wi-Fi CC3000 and MSP430FRAM5739 with;

          TI ULN2003ULN2003 Darlington Drivers

          TI LM324 OP AMP

          TI uA7805uA7805 Voltage regulator

          TI DAC5311IDCKT.DAC5311IDCKT. Digital to Analog Converter

          FRAM Buffer

          Relays

          Assorted passive components           

Vending Machine

This is an example of where a food dispensing machine can be easily controlled and monitored from the Internet.

Items used include;

     TI ULN2003ULN2003 Darlington Drivers

     Relays

     Digital inputs

 

Here is a picture of the machine prior to modification.

web vending.jpg

 

This concept can be extended to other food, paste and liquid dispensing systems.

 

Animated Laser Display

Many Animated Laser displays have an ILDA Interface and DMX port. I am in the process of making an ILDA interface for the SimpleLink Wi-Fi CC3000 and MSP430FRAM5739.

Doing this can remove the need for a wired DMX interface making it far easier to deploy the display units.

     The interface requires suitable DACs and appropriate analog differential signalling.

     (More on this later)

 

Patient Health monitor

This is to assist health professionals and careres to read non vital signs from many patients simultaneously.

The only proviso is that the patient is within the range of a suitable WiFi access point.

     A non-contact Texas Instruments TMP006AIYZFTTMP006AIYZFT Thermopile is used to read patient temperatures.

 

     Continual Blood pressure measurement with a cuff is impractical and is out of scope for the moment.

Weight change sensor

     This integrates and existing digital scale with the SimpleLink Wi-Fi CC3000 and MSP430FRAM5739.

      It has a variety of potential purposes including automated inventory and ordering system, patient movement or even an alarm system.

Complete Home Automation system

     This system comprises of a SimpleLink CC3000 with MSP430FRAM5739 coupled with a Texas Instruments C2000 Multi-DC/DC LED Kit and Texas DRV8412-C2 Integrated Motor Driver Kit

     The additional modules are better suited to DSP and more intensive processing activities.

     But like an any organisation, the managing unit (in this case the MSP430FRAM5739) does not necessarily require more processing power that its subordinates to co-ordinate control.

COMPACT

Project "code name" Part 012

Posted by COMPACT May 22, 2012
22nd May

"My long lost twin has just shown up on my doorstep."

I have just taken delivery on my second Fraunchpad. This allows me to use both CC3000 WiFi modules concurrently thus opens Pandora's box for more possibilities.

Including a backup spare if I should accidentally blow up or fry the original one.

I always feel safer with an emergency Plan B on hand.

 

I've plugged in the Murata CC3000 Module, uploaded the HA demonstration app and both appear to work fine.

More testing is required.

 

The Murata module is considerable smaller that its LS Reseach counterpart but its performance may differ because it has a different and what appears smaller antenna configuration and a tap point connector.

Using this module with a MSP430FRAM5739 on a custom PCB would produce a very small device indeed.

 

The plan for tonight is to set up a Twitter account so that I can twitter the new Fraunchpad and display.

This will involve modifying the standard CC3000 Home Automation with Twitter demonstration example and integrating it with an LCD interface.

 

Wishful thinking.

Let's see how I go.

 

Addendum:

I've never used Twitter before so I created an account then created an application and finally associated the application with the account.

This generated all the necessary parameters required in the manifest.xml file to make the HA demonstration work with Twitter.

The whole CCS not finding things has been narrowed down to the machine as a whole. It either needs a holiday or a kick/complete reinstall. Not a fun task either way, so in the meantime there will be a quick switch to mspgcc. This should at least provide a little bit of help while I try out the recent delivery.

This week was special, it was the delivery of the last few (Hopefully!) parts. TI need a round of applause here for their fine courier selection. To go from getting the despatch email at 05:01 to having a package in your hands that afternoon is amazing. Lets just ignore the fact that the courier may well have been using time travel at this point as getting the stuff across the sea in that time is a bit unlikely…

 

Cue exciting box photos.

 

First up is the light component of the project, the LED driver. Based on the requirements, the TPS61042EVM was chosen. In the ever so slightly misleading box you will find three things, the evaluation module (actually really tiny), the manual for the EVM and a datasheet for the part. Yes, this particular EVM contains printed copies of the documents. There is a lot of discussion going on about paper copies of documents such as this, a quick search will show you a few on element14, but personally, with parts like this is a great help. On the times you are setting up a EVM to use and finding you are rapidly running out of space, a laptop can be a little inconvenient, where as a paper document you can easily move around or lie one top of things without risk of damaging them is rather useful.

 

LED.jpg

 

Second up is the motor driver, in this instance it is the DRV8805EVM. Chosen for its stepper motor capability, in particular the step function and direction control, this IC should make the driving of the blind much easier. In the box is the PCB holding the driver IC and a MSP430MSP430 to control it. Should you just be after testing the driver, the MCU can be bypassed so you can control the device with your own signals. Also present is a handful of test points so you can monitor exactly what is going on. The box contains a USB lead so you can program the onboard MSP430 with your applications or the demo applications. Sadly this kit does not include any datasheets like the LED driver kit, they are all available online however.

 

motor.jpg

 

Last up is the networking portion. Although this project uses WiFi for the control part, it is designed to be able to control different rooms. Doing this with WiFi would be a little impractical, however there is a nice little protocol designed for this kind of task, ZigBee. This protocol has a few application profiles which demonstrate what it is good for use in, one of these is a Home Automation application. Taken from Wikipedia on the subject, typical uses include “Home Entertainment and Control — Home automation, smart lighting, advanced temperature control, safety and security, movies and music”, so essentially what we are aiming for. To make it even more suitable, TI have the CC2530CC2530 ZigBee Network Processor Mini Development Kit. In the box is a coordinator module and two end devices, each using the CC2530 IC to handle the ZigBee network and a MSP430 to control that and hold your application.

 

zigbee.jpg

 

A few notes about these, watch out for the motor kit as it is liable to get hot. Its what happens with that much current! For the ZigBee kit, users in Japan need to pay attention to the local laws. The kit contains a useful leaflet about the requirements for using it (Suitably protected lab etc), make sure you pay attention. Finally, the LED driver kit contains its own LEDs which unsurprisingly can get a bit bright. You may want to take some precautions around this like a filter over it to dim it slightly. The user guide also warns that the device may get a little hot (60C+), so be careful with that. Your own fault etc if you accidentally cook a finger

IMAG0005.jpg

The first run!

 

While it has been seen that the MSP430MSP430 chips work well, I seem to be plagued by compiler issues, whether it be the IDE having issues, the compiler just not liking files, gmake being difficult or just Windows being massively unstable. I would try it through Ubuntu, but that doesn’t like the USB drivers for some reason. Odd udev rules I think.

 

With the application of another processor though, it is possible to get the new kit up and running. In this case, using an Arduino to generate a PWM signal (possibly dirty and not at all following the datasheet advice), the LED driver can be controlled, and it does exactly what is needed. Time to try and work out the rough values for the levels of light.

 

 

The motor controller isn’t so easy. The supplied demo software works well and controls the chip in an appropriate manner. The problem is with the motor. Seems I have bipolar ones and not what I though they were. Quick trip to ebay to sort that I think.

 

The ZigBee kit is for testing tomorrow. Time to see if I can fix the mspgcc sample makefile to at least get small test programs running. I fear the main project source will require CCS to compile properly, but I’m confident any issues will be simple tweaks so for now can remain as it is on github. With any luck the smaller individual components and protocol will work, it will just be a case of them compiling when put together (wlan.h was a common error when the compiler was working, the rest usually worked). We shall see what happens after a few kicks, more swearing at it and a different approach. In the event the compiler wasn’t MIA, I am sure the project would work well on hardware, any electronics issues will be down to minor mistakes by the software guy.

COMPACT

Project "code name" Part 012

Posted by COMPACT May 19, 2012
20th May

"Do you have the balls?"

Here is the SimpleLink Wi-Fi CC3000 driving a low voltage plasma ball.

web ball.jpg

It looks cool but not much at all is going on under the covers.

All I'm doing is controlling a relay that switches the power to it.

It just requires +5V at 300mA.

COMPACT

Project "code name" Part 011

Posted by COMPACT May 19, 2012
20th May

"But there are alternatives.."

As not to encroach on Nick's work with load cell interfaces, I have interfaced a set of digital scales in a completely different way to retain its original functionality and appearance.

web digital scales.jpg

 

My scale has an ASIC with I2C ROM that does all the work and I'm letting it do all the load cell management.

 

Like my previously mentioned mystery device I have reverse engineered the digital scales to find suitable interface points to tap.

At this moment I am purely using the scales as a pressure switch.

When a preset threshold pressure is reached (either in a positive or negative sense) it will assert a digital signal which the SimpleLink Wi-FI C3300 can process such as send a twitter message or SMS.

 

This is accomplished using just 3 wires;

     Ground

     On/Off and Zero Function

     "minus" LCD signal

 

Depending upon the circumstance, an additional actuator may be necessary to reset the threshold pressure setting or prevent the unit from automatically turning off.

This is to lift or place a calibration weight on the scales to either zero the setting or present signs of activity.

 

All that is going on is under program control, setting the Zero point to the threshold setting and checking the display for a positive or negative reading. 

web digital scale guts.jpg

 

The On/OFF LCD signal is used to turn the scales on and if necessary reset the desired threshold setting.

The "minus" LCD signal is not a digital logic level signal but an AC multi level LCD drive signal.

With a bit of decoding of this signal can be interpreted as either "minus" segment on or off.

COMPACT

Project "code name" Part 010

Posted by COMPACT May 19, 2012
19th May

web Dog Tag.jpg

Just an update...

The PCB modules have been loaded and are in the process of being tested. So far every test has passed.

I'm just working on the code at the moment.

I shall keep you all posted.

 

Meanwhile, someone put me on to this Kickstart project which to me makes no sense because it can be done at a fraction of the cost by acquiring Texas Instruments SimpleLink CC3000 and opening the box.

http://www.kickstarter.com/projects/supermechanical/twine-listen-to-your-world-talk-to-the-internet

 

I find it interesting out there that they've raised over $500,000 and that there are so many persons out there who are willing to part with their money without the proper research.

 

Here's details of the SimpleLink CC3300 Home Automation example project.

http://processors.wiki.ti.com/index.php/CC3000_Home_Automation_Description

 

Does it look similar or perhaps identical?

HNTE

The Bread & Butter : 06

Posted by HNTE May 16, 2012

May 16th : Grace Tutorial as Promised

I mentioned a few weeks back how much I loved the grace tool, and I said I would make a video tutorial.. So here you go! This is the first time I have done a spoken tutorial so hope it turned out ok..

It the video I will go through setting up a grace project which will use a capture compare timer to blink an LED every 500ms. Normally for a new chip this would mean digging through data sheets to figure out how to set up a timer, not any more!!

 

 

 

 

More Weight Scales

The other day I managed to communicate with the ADS1131REF board via serial, but I was left stumped by the data I was getting. Turns out I was just being an idiot, the data returned was not weight data but the raw voltage reading from the output of the sensor. To convert the raw voltage to a usefull weight I needed to calibrate the sensor (of course!). The claibration uses the simple equation below to convert the sensor reading to a calibrated weight.

 

eq.png

Whats Next?

So far I feel like my blog posts talk a whole lot but don't really show my progress, hopefully this weekend I can fix that by bringing a whole lot of this information together into something that resembles my original idea.

 

Cheers!

 

Bread & Butter : 07

HNTE

The Bread & Butter : 05

Posted by HNTE May 14, 2012

May 14th : Yar!

 

Time to try and communicate with this ADS1131REF board so I can integrate it into my little group. I was looking forward to this because I could finally give my new bus pirate a go.

The designers kindly left some test points available on the reference board for the UART interface, I have highlighted these in the image below.

 

ADS1131TR.jpg   

 

ADS1131REF UART SETTINGS

 

115200 baud

8 data bits

no parity

1 stop bit

no flow control

 

Once I hooked up my bus pirate it was fairly easy to get data off the board using the UART using the settings as above. The ADS1131REF accepts several simple commands to get data and.. well that is about it, it is a very basic command set..

 

 

t2.png

So getting the data was not a problem, now I have to do something with it. At the moment the hexadecimal values that I am getting don't seem to make a whole lot of sense, I am sure I will figure it out soon enough.

 

 

The Bread 7 Butter : 06

So it seems a bad week has gradually got worse. Out of the blue, it seems the toolchain used by CCS has disappeared (but hasn't) meaning that nothing can be compiled. While I can still write the code, there is currently no way of testing it. Rather infuriating at this point, but we shall try again another day.

The second problem, and the slightly more annoying one, is the display. After another afternoon of work, three different processors and offering to take a hammer to it, it still doesn't work. There is unfortunately no way of testing whether it is the LCD itself or the onboard controller. Although there was progress with getting it to power up and show something (A line, which looked a lot like a glitch), that soon disappeared. Despite the variations in the code, both from the datasheet and and based on the obvious "throw some data at it to display", nothing seems to be displaying. It seems that it is most likely the onboard controller that is at fault. After sending the first bit of data, the system tends to just hang, presumably from the I2C drivers blocking while waiting for an acknowledgement.

 

The upside of this week however is that the motor and light drivers have been narrowed down. The current choice for the LED driver, needed to adjust the brightness in the room, is the TPS61042EVM-226. This is should provide the PWM control required rather than varying the voltage going to the driver. Similarly, PWM is planned to control the motor. By doing this, a few options are left open in terms of the type of motor. At present a stepper motor is on the cards, for this reason a suitable driver is needed, such as the DRV8805EVM. Out of the range for this part, this particular one has a step function that can be pulsed to move the motor on one space. Applying this pulse through PWM should keep it moving for the time required. In the future, should a stepper motor become impractical for any reason, this method would mean no software would need to be changed (duty cycle may need varying, but compared to implementing a new driver it is fairly simple). It would just be a case of plug in the new driver, assuming a standard format for connections between the motor control board and the motherboard part (Lovely modular design that possibly won't make it onto the first PCB)k, and continue.

 

The plan for this coming week is to get CCS working again, or find the MSP GCC tool to at least try and get going with that. Meanwhile a bit of shopping needs to be done to stock up on perfboard and some rather useful supplies. I would highly recommend stocking up on parts like JST (JAPAN SOLDERLESS TERMINALS) - SMF-20LV300-D. - LEAD, CRIMPED, 300L JST (JAPAN SOLDERLESS TERMINALS) - SMF-20LV300-D. - LEAD, CRIMPED, 300L , they are something of a life saver when you need some terminals on a lead. Some small pieces of protoboard are also a great help. With the LCD being used, a small breakout board was needed. A small section of ribbon cable (nice and thin to match the small spacing on the pins), a tiny protoboard and some of the crimped leads make a decent adapter and provide space to include some of the support circuit like caps and pullup resistors. The advantage of the crimped leads is that you do not need to change the headers on the FRAM board, you can just slide them on. Without the plastic cover, they are not the most secure, but remembering not to put your pen under the cables will help that!

IMAG0003.jpgIMAG0004.jpg

COMPACT

Project "code name" Part 009

Posted by COMPACT May 11, 2012
12th May

Sound Advice

Here is the PCB just off the mill.

It hosts the DAC, sound buffer and output buffer.

The output buffer is just an LM358 OP amp to protect the DAC. It is configured for unity gain.

web sound advice PCB.jpg

 

 

Here is a dry fitting of the adapter PCBs and connectors.

web sound advice dry fitting.jpg

CAD makes things so easy to line up!

HNTE

The Bread & Butter : 04

Posted by HNTE May 11, 2012

May 11th : Time Flies When You Are Having Fun

Wow I didn't realise I had lost so much time. So this post is a bit of a catchup to show that I have not been doing completely nothing.

Part of my project will involve measuring the weight of some bread and milk, that's what those cheap scale and load sensors were about a few weeks back.

To get any useful data from my scavenged load sensors I needed to get myself some sort of high precision ATD converter.

 

Weigh It Up

 

Meet the ADS1131, a high precision 18 bit analogue to digital converter with an onboard amplifier, it is perfect for load sensor applications (just read the datasheet).

To test out the chip I decided I would give the TI evaluation kit a go, you can check out the ADS1131REF in the photo below.

 

ADS1131.JPG

So it looks like the board is completely decked out with everything you would need to make your own set of scales. One thing it was missing was a normal sized DC power jack, I have a huge tangled box of wall wart transformers but none of them would fit the supplied jack. Not to be deterred I just piggybacked a normal sized jack on top of the original (saves me from using the backwards 9V battery connector). Oh and another thing, when I received the board it stank! I know this is probably the strangest comment to make on a piece of electronic kit, but it did, I had to air out my room. Anyway.. Let's move on, because this thing is actually pretty cool.

 

ADS1131_POWER.JPG

 

Before you measure anything you have to calibrate the sensor, this is easy enough. You just press the CAL button and follow the prompts, by default the calibration weight is set to 1kg. If you need to change the calibration weight like I did you just press the two PARM buttons at the same time to get to the menu. So you don't have to calibrate every time you turn the thing on, you can save the calibration settings into flash memory. To do this the datasheet tells you to look for instructions in section 3.4.1, don't listen to it, it's tricking you, look in section 2.4.1 instead.. Or just listen to me, enter the menu after calibrating the sensor (press both PARM buttons) scroll right untill you find the "SAVE?" screen, now hit ENT. Simple..

 

test.JPG

 

So the next thing to do is get the evaluation kit talking with the rest of my little network, but for now I have some other things to show you..

 

Eagle Goes 3D

I have played with eagle in the past, it is a very powerful piece of kit and the free version has always let me do what I want.

My first board design for my Bread & Butter project is the control board for my clever containers. It is just an MSP430G2553 with a programming header and four points to wire up the LDRs which will detect the level of the goods in the containers. In the images below the LDRs show up as LEDs, I couldn't find an LDR device in eagle so I just used something with adequately spaced holes.

 

To generate the 3D image I used eagle3D and POV-Ray, once you get the hang of it it is really easy to use, and it generates some really nice 3D images. 

 

brd.png

Container.png

 

OK I seem to be having all sorts of trouble with the editor crashing and my pictures disappearing at the moment, so I might come back and try again tomorrow.

 

Cheers!

 

The Bread & Butter : 05

COMPACT

Project "code name" Part 008

Posted by COMPACT May 9, 2012
10th May

"Current State of the Union"

The DAC has been working perfectly generating the desired waveforms and has been disconnected to make way for FRAM driver development.

web progress p008.jpg

This is just a progress picture showing the current elements under development showing the FRAM connected to the Fraunchpad and the DAC placed beneath it.

The Relay driver board now has a National Semiconductor LM3940-3.3V linear regulator attached.

Although originally for a uA7805uA7805, I am driving the voltage regulation circuit in reverse to get 3.3v from a regulated 5v input.

Since everything in this area is working in reverse with inputs becoming outputs and outputs becoming inputs no PCB mods were necessary.

I annotated the voltage input and output pins to ensure that I would not connected them the wrong way around.

 

The 3.3v is used to power the Fraunchpad and connected 3.3v peripherals.

COMPACT

Project "code name" Part 007

Posted by COMPACT May 8, 2012
8th May

Disaster Strikes!

This morning when I went to turn my main PC on, it didn't.

Not a blip, not a sigh, not a wimper, nothing.

I run full backups all the time so recovering information wasn't my primary concern.

It was getting the machine up and online again to continue work.

 

Hint to everyone: Perform Full system back ups frequently.

Don't kid yourself by just copying documents to a memory stick or single External Hard Disk.

And... Don't keep all your eggs in one basket and be prepared for full metal restorations.

(That is a complete hardware swap out)

 

My workstation has a fancier than normal power supply that has a 5 year warranty and it was time to use it.

In the meanwhile I obtained a equally capable but temporary replacement (which comes with a lifetime warranty).

The manufacturer decided to change the "Cable Management" connector system so I had to replace all power cables.

Once this was done, power was connected, power button pressed and voila!

 

And here I am now using it.

 

This new power supply has a unusual but very useful longevity feature.

After system shutdown, the power supply fan stays on for a fair while to dissipate heat rather than the norm where the fans turn off and the temperature of the power supply rises before cooling.

This removes the unneeded stress.

 

This new Power supply is also 89% efficient between a load of 20%-100% and with standby power of 1 Watt.

Suffice it to say that it has Auto PFC.

Green indeed. The extra bucks spent is recouped by longevity and power savings.

COMPACT

Project "code name" Part 006

Posted by COMPACT May 7, 2012
7th May

DAC's extremely possible

A few persons are interested with my use of a DAC so here's a quick explanation.

I could have used an inbuilt timer, PWM and filter network but I decided to experiment with a DAC and some additional buffer 2Mbit (256k * 8) FRAM memory.

Although out of scope of the Road Test guidelines, I am experimenting with WiFi audio communications using the CC3000 and Fraunchpad.

Without resorting to any CODEC, compression algorithms or additional ASICs I wanted to give my project a voice.

This will be accomplished by uploading raw PCM data via WiFi to the 256Kbyte buffer and replaying under MSP430MSP430 control.

 

The PCB should be completed shortly with testing commencing immediately after.

 

I could be making a talking scale that says "One at a time please!" or may be making something completely different.

While working on the PCB, I realised one thing. I haven't found a display yet! (Pretty useful!) There is a challenge here, the MSP430FR5739 being used does not have a built in LCD module, so any solution will have to be in software or using a different interface. The best option for me here will be to use the I2C interface for a couple of reasons. The first being SPI, I have rarely used this interface, and while MSP430ware does provide some nice functions for it, if possible I'd like to keep the SPI connection dedicated to the WiFi for simplicity when it comes to debugging. Second is the number of GPIO used for it. At last count, this was slowly running out, while this count be changed by adding something like a 595 IC to handle the LEDs in the system and cut down the GPIO being used, it is not entirely necessary right now. Thirdly, I'm going by the Stick to what you know method for these parts and as it happens I have used I2C before. With the addition of the MSP430ware API, there shouldn't be too many problems. This should remove the need to find or write/port a library to handle a HD4470 compatible LCD controller.

 

With this in mind, time to go have a look through the element14/Farnell store for possible options. A quick search brings up options such as MIDAS - MCCOG21605C6W-BNMLWI - LCD, COG 2X16, NEG STN, W B/L, I2CMIDAS - MCCOG21605C6W-BNMLWI - LCD, COG 2X16, NEG STN, W B/L, I2C This particular LCD comes with a very good datasheet (Something some products lack). At present however, all I have is BATRON - BTHQ21605V-COG-FSRE-I2C - LCD MODULE, ALPHANUMERIC, 2X16BATRON - BTHQ21605V-COG-FSRE-I2C - LCD MODULE, ALPHANUMERIC, 2X16, so lets see how that goes. On a side note, the Batron LCD has two possible addresses, 0111 010 and 0111 011. (First time I used it, this one stumped me. The address certainly isn't listed in the Batron datasheet which is really quite frustrating!

 

Getting the LCD to display things shouldn't be too hard, the MSP430ware API document has a good example to get you going.

#define SLAVE_ADDRESS 0111010

//Initialize Master
 eI2C_masterInit(__MSP430_BASEADDRESS_EUSCI_B0__,
                              eI2C_CLOCKSOURCE_SMCLK,
                              //UCS_getSMCLK(__MSP430_BASEADDRESS_UCS__),
                              1000000,
                              eI2C_SET_DATA_RATE_400KBPS,
                              1,
                              eI2C_NO_AUTO_STOP );

//Slave address
eI2C_setSlaveAddress(__MSP430_BASEADDRESS_EUSCI_B0__,
                                   SLAVE_ADDRESS );

//Set in transmit mode
 eI2C_setMode(__MSP430_BASEADDRESS_EUSCI_B0__,
                         eI2C_TRANSMIT_MODE );

//Enable I2C Module to start operations
eI2C_enable(__MSP430_BASEADDRESS_EUSCI_B0__);

//Send single byte data.
eI2C_masterSendSingleByte(__MSP430_BASEADDRESS_EUSCI_B0__,
                                             transmitData );
//Delay until transmission completes
 while (eI2C_isBusBusy(__MSP430_BASEADDRESS_EUSCI_B0__)) ;

 

I do find one thing annoying about MSP430ware however. The API user guide is a little...sparse when it comes to function descriptions. In order to get the arguments for a function you need to refer to the API header files. They are simply not listed in the PDF. While not a huge problem, it can be a little frustrating to have to switch between more documents than necessary in order to understand an example.

 

Should this LCD not work (Rather likely if a previous project is anything to do by), something different will have to be dreamed up. LED digit display with a cunning bit of paper describing the meaning may work until something else comes up. Time to research implementing a 595 I think! Also on the cards this week is finalising the  shopping list for motor control and LED drivers. If you have any suggestions for these, please leave a comment!

COMPACT

Project "code name" Part 005

Posted by COMPACT May 3, 2012
4th May

DACs the way aha aha I like it aha aha....

The MSP430FR5739 does not have an inbuilt DAC so I have connected up a Texas Instruments DAC5311 8 bit SPI DAC.

To do this I made an adapter PCB. Apologies for the poor picture.

web poor DAC pic.jpg

The DAC is so small that it is like soldering a speck of dirt with legs.

It can be easily upgraded to higher resolution versions like the DAC8411, DAC8311, DAC7311 and DAC 6311.

HNTE

The Bread & Butter : 03

Posted by HNTE May 1, 2012

May 1st: A Network of MSP430s

So getting my little network was not as easy as I had hoped. Sure it is simple enough but I kept running into problems or just making very silly mistakes.
In my last blog post I showed you a picture of how I would lay out my network, with the CC3000/FRAM at the centre I2Cing to all it's children. I ran into my first problem when I realised that the I2C/SPI module was already being used on the board by the CC3000.
To fix this I decided I would use the serial UART interface and use a launchpad as a brother to the CC3000/FRAM board.

 

Brotherly Love

You can see in the picture below the master FRAM board connected to the brother launchpad and my re-purposed ATX desk power supply with a chopped up usb cable to power the whole lot.

One convenient off shoot to this setup is that I can let the brother do all of the work looking after all of the sensors so that the master can do more important things like talk to the computer (overlord?)...

brother.JPG

 

Serial UART

Setting up the serial UART between the master an brother was easy enough, for the master I just used some of the dispatcher code that came with the CC3000 demo code. To program the brother I used what I think is the best tool I have ever used for programming embedded devices... Grace...

Grace is TIs graphical programming environment for a whole bunch of their devices, it is essentially an interactive datasheet where you can just click on the peripherals you want to use and set them up as you would like. Not only that it generates perfectly commented C code so you can see how it can all be done without Grace.

 

I will make a bit of a video tutorial of Grace soon, but at the moment I am a little short of time. So once you have set up the various clocks and uart specific instructions you just have to add some code (which grace helps you with) to use your new serial interface. You can see my send and receive functions below, the receive is handled in an interrupt so no polling is required.

 

unsigned char uart_rx_buffer[8];
int uart_rx_byte_pointer = 0;
char instruction_received = 0;


void UartSend(unsigned char *data, int length){
          while(length>0){
                    while (!(IFG2 & UCA0TXIFG));
                    UCA0TXBUF = *data++;
                    length--;
          }
}


void UartReceive_ISR(void){
          uart_rx_buffer[uart_rx_byte_pointer] = UCA0RXBUF;


          if(uart_rx_buffer[uart_rx_byte_pointer] == '!'){
                    uart_rx_byte_pointer = 0;
                    instruction_received = 1;
          }else{
                    uart_rx_byte_pointer++;
          }
}

 

Looking after the children

So the brother can now chat away with the master, so now I needed a way for the brother to keep tabs on all of the children. Although at the moment I only plan to have four condiments being measured I am making sure everything is as flexible as possible for upgrades in the future.

To store all relevant food data I have set up an array of structures which my lanuchpad brother can use to store the levels of all the child containers it can find.

 

The code below handles all of this (except for the I2C bits which I will talk about later). When the PC sends a request for food levels, the CC3000/FRAM master relays this command to the launchpad brother over the uart. The brother then updates the content of all the locations using the I2C interface. If for some reason the I2C request fails the returned data is set to XX to let the PC know that the particular foodstuff could not be found (i.e probably an error). If the particular foodstuff was there last time but, but not currently there (i.e. someone is using it) then the old data is returned but a '0' is appended to the data to let the PC know that the data is not up to date.

 

The way I have set this up it will not matter if you pick up one of the clever containers and place it back on a different location on the smart shelf.

 

typedef struct{
          unsigned char i2c_address;          //Address directly related to location list number
          unsigned char content;                    //current content at this location
          unsigned char level;                    //the level of the content
          unsigned char current;                    //1 is this data is current, 0 is the last update failed
}locations;

int NUM_OF_LOCATIONS = 2;

locations location_list[8];

void brotherUpdate(void){
          int i;
          for(i = 0; i < NUM_OF_LOCATIONS; i++){
                    if(I2cReceiveFrom(i+2, 2)){
                              location_list[i].i2c_address = i+2;
                              location_list[i].content = getI2cByte(0);
                              location_list[i].level = getI2cByte(1);
                              location_list[i].current= 1;
                    }else{
                              location_list[i].current = 0;
                    }
          }
}

unsigned char findAddress(unsigned char this_content){
          int i = 0;
          for(i = 0; i < NUM_OF_LOCATIONS; i++){
                    if(location_list[i].content == this_content){
                              return location_list[i].i2c_address;
                    }
          }
          return 0;
}

void returnLevel(unsigned char this_content){
          unsigned char location_address;
          unsigned char return_string[4];

          brotherUpdate();

          location_address = findAddress(this_content);

          if(location_address > 0){
                    return_string[0] = location_list[location_address - 2].content;
                    return_string[1] = location_list[location_address - 2].level;
                    return_string[2] = location_list[location_address - 2].current + '0';
          }else{
                    return_string[0] = this_content;
                    return_string[1] = 'X';
                    return_string[2] = 'X';
          }

          return_string[3] = '!';

          UartSend(return_string, 4);
}

 

So the test setup looks something like this.. The mdf with the three aluminium tabs on it is my prototype smart shelf, I have moved away from IR communication for something better (but that is talk for next time).

Next time I will show you some of my I2C code and also describe my new idea for communicating between the smart shelf and the clever containers.

 

child.JPG

 

The Bread & Butter : 04

COMPACT

Project "code name" Part 012.5

Posted by COMPACT May 23, 2012
23rd May

"Interesting developments"

I have just discovered an application called www.supertweet.net to simplify device integration with Twitter.

This application allows the use of the original programmatic Twitter interface to the current oAuth interface by means of a proxy server.

This makes it far simpler to interface TI SimpleLink Wi-Fi CC3000 devices to Twitter.

 

All you need to do is provide the now pseudo twitter credentials and the more complex oAuth authentication is done on your behalf by the supertweet proxy server.

From the Twitter end everything seems normal and from your device it appears that the original interface still exists for the exception that the target is www.supertweet.net

A nice feature is that these pseudo twitter password can be totally different your original on.