Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

remotewizard's Content

There have been 31 items by remotewizard (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#52399 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 27 August 2013 - 10:38 PM in General Discussion

I have one of the typical cheapo four-module 7219 LED matrices (e.g. four panels of 8x8 each, with power, ground, clock and cs daisy-chained; each module after the first gets it's DIN from the previous DOUT).  I downloaded the current Max72197221.cs from Netduino Helpers, and was able to send letters and patterns to the first module.  So far ,so good.

 

However, according to the 7219 datasheet, I should be able to address each of the subsequent modules by sending a No-Op after each row of data (the four 7219 chips acting as a shift register) for each module I want to move to the right.  But sending what I think is the right value to the matrix doesn't work.

 

For example, I changed the original Max72197221.cs code to define SpiBuffer as ushort[2], and modified the Write subroutine as follows:

 

protected void Write(byte register, byte value) {

SpiBuffer[0] = register;

SpiBuffer[0] <<= 8;

SpiBuffer[0] |= value;

 

SpiBuffer[1] = (byte)RegisterAddressMap.NoOp;

SpiBuffer[1] <<= 8;

SpiBuffer[1] |= 0;

 

Spi.Write(SpiBuffer);

}

 

But the display doesn't - well, display.  It also doesn't work when defining SpiBuffer[1] simply as 0 (without all the bit-shifting nonsense).  Can anyone help me spot the flaw in my logic?




#52412 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 28 August 2013 - 11:49 AM in General Discussion

I thought so too, and actually tried it that way first.  It didn't work either.  And researching the 7219 online lead to my trying it the other way.

 

Such a simple thing, and so frustrating!




#52418 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 28 August 2013 - 05:59 PM in General Discussion

Same thing: when I tried sending live data twice, only the first module responded.  I'm reletively certain it's not a hardware issue, as I was able to get all leds on all modules to light using my Bus Pirate.

 

The two transfers is a good idea; I'll give that a try. 

 

Do you think the new enhanced SPI (which permits transferes other lengths than 8 or 16 bits) might help?

 

Thank you as always, my friend, for taking the time to help.




#52431 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 28 August 2013 - 07:29 PM in General Discussion

Very nice!  I'll try this as soon as I get home from work tonight!  I'll keep you posted.

 

I note the Thread.Sleep in your write method - perhaps my problem was a timing issue?

 

Thanks to both of you!




#52436 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 28 August 2013 - 10:18 PM in General Discussion

I should probably ask if you could share the code for MultiSPI4SevenSegment. 




#52442 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 29 August 2013 - 12:06 PM in General Discussion

I like simple!  And VB isn't simple at all - just different. 

 

I appreciate the additional information.  I'll give it a try tonight.

 

Thanks again!




#52443 Long live the Netduino

Posted by remotewizard on 29 August 2013 - 12:13 PM in General Discussion

Actually, I like my Raspberry Pi in its role as an Internet radio streamer (running nothing more exotic than mpd) controlled by a Netduino (as part of my multimode radio project).  Different tools for different jobs, and all that.

 

But I really like coding in Visual Studio on a Windows machine.  I guess I'm not all that hip. :)




#52471 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 30 August 2013 - 12:32 PM in General Discussion

I'm an idiot.  But you all knew that already. :wub:

 

First, I couldn't get JoopC's code to work any better than mine.  So I immediately decided I had a hardware issue (despite my success with the Bus Pirate) and decided to do some research.

 

I found a post online that said thant when sending multiple bytes to the chained matrices, all bytes have to be sent within a single ChipSelect(false)/ChipSelect(true) pair.  So I went back to my original code, set the cs pin to GPIO_PIN_NONE in the SPI constructor, set up an OutputPort for the chip select (per http://forums.netdui...l=gpio_pin_none - thanks CW2!), and send my bunch of bytes. 

 

And it worked! 

 

Sort of - the intensity isn't right, and I'm getting display on every other matrix (rather than adjacent ones).  But it's a start.

 

If and when I ever get this fully working, I'll post my code.




#52473 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 30 August 2013 - 01:54 PM in General Discussion

If I'd have read that more closely, it would have saved me hours of screwing around.  I should know to pay more attention to what you suggest!

 

Thanks again!




#52475 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 30 August 2013 - 03:32 PM in General Discussion

Not yet; I'm using a Plus 2, and I believe there's a problem with SPI and variable word length.  But I won't swear to it.




#52505 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 02 September 2013 - 07:37 PM in General Discussion

Getting there...

 

http://youtu.be/xYyo6ZzX_J0




#52531 Embarassing SPI question (re: Netduino Helper Max72197221.cs )

Posted by remotewizard on 03 September 2013 - 06:13 PM in General Discussion

Manual control; I ser SPI CS to PIN_NONE, and manually toggled an output port at the start and beginning of my multi-digit write.

 

My biggest problem was all the fonts I could find online were rotated 90 degrees on my cheap set of LED matrices.  I found a freeware app that let me create my own fonts, which came with a sample that worked quite nicely as-is!

 

Right now, I have the font arrays stored in a hashtable, with the equivalent character of the alphabet as the key.  Clunky, but it works. still, I'm going to just set up a simple array and use the ASCII value as the index, and see if that affects performance or memory usage.

 

Thanks again everyone for your help!




#52544 Output options for multiple, seperate, chaser LED strips.

Posted by remotewizard on 04 September 2013 - 12:17 PM in Netduino Plus 2 (and Netduino Plus 1)

I'm obviously no expert, but I believe you can control multiple SPI devices by maintaining multiple SPI configurations (each with a different SS pin); you switch control by loading the appropriate configuration into the single usable SPI device. 

 

Would that work for you?  Or did I misread your question.




#52650 Easiest way to use QS30-1 Nixie Tube Module?

Posted by remotewizard on 08 September 2013 - 07:20 PM in General Discussion

I put this aside until I got caught up on other projects, and finally took another look.  Turns out that using SPI to send data to the Nixie tubes was trivial, and using PWM to control the brightness was even more so!

 

7654-small.JPG

 

Thanks again!




#53197 Netduino Plus 2 + Adafruit Motor Shield V2 for Arduino

Posted by remotewizard on 14 October 2013 - 07:50 PM in General Discussion

I'd also like this information; I have a Switec stepper running directly from four digital ports on my N+2, but I'd really like to use the I2C control of the Adafruit MotorShield v2.




#53218 Netduino Plus 2 + Adafruit Motor Shield V2 for Arduino

Posted by remotewizard on 15 October 2013 - 08:34 PM in General Discussion

Or not; it might be easier (and a whole lot cheaper) for me to just connect the Switec to a MCP23008.




#53536 Easiest way to use QS30-1 Nixie Tube Module?

Posted by remotewizard on 24 October 2013 - 08:26 PM in General Discussion

Sorry - I only just saw this now.  I'll try to dig out the info over the weekend and post it ASAP.




#53665 Easiest way to use QS30-1 Nixie Tube Module?

Posted by remotewizard on 26 October 2013 - 07:36 PM in General Discussion

Back again!  Please note that my connection information is from handwritten notes; you'll want to double-check the DFRobot documentation before actually trying this out.

 

I daisy-chained all four Nixie modules together, then connected an external 12V supply to pins 7 and 9.  I then connected:

 

Pin 1 (DIN) => Netduino pin D11

Pin 2 (ST)   => D8

Pin 3 (SH)   => D13

Pin 4 (OE)   => D5

Pin 5 (GND) => ground

Pin 6 (+5)   => +5

 

I haven't got as far as writing a proper class just yet; this is more of a proof-of-concept.

namespace NixieTest2{    public class Program    {        public enum Color        {            White,            Yellow,            Cyan,            Green,            Magenta,            Red,            Blue,            Black        };        public enum Colon        {            None,            Upper,            Lower,            Both        };        public static void Main()        {             OutputPort ChipSelect = new OutputPort(Pins.GPIO_PIN_D8, false);             PWM BrightnessControl = new PWM(PWMChannels.PWM_PIN_D5, 1000, .5, true);             BrightnessControl.DutyCycle = .5;             BrightnessControl.Frequency = 1000;             BrightnessControl.Start();            var spiConfig = new SPI.Configuration(                SPI_mod:  SPI.SPI_module.SPI1,                             ChipSelect_Port: Cpu.Pin.GPIO_NONE,                ChipSelect_ActiveState: false,                ChipSelect_SetupTime: 0,                ChipSelect_HoldTime: 0,                                Clock_IdleState: true,                Clock_Edge: true,                Clock_RateKHz: 1000                );           SPI Spi = new SPI(spiConfig);           ushort[] bufOne = new ushort[1];           ushort[] bufTwo = new ushort[1];           ushort[] bufThree = new ushort[1];           ushort[] bufFour = new ushort[1];           bufOne[0] = 0;           bufTwo[0] = 0;           bufThree[0] = 0;           bufFour[0] = 0;            ChipSelect.Write(false);            Thread.Sleep(20);                         Spi.Write(bufOne);            Spi.Write(bufTwo);            Spi.Write(bufThree);            Spi.Write(bufFour);            ChipSelect.Write(true);                        Thread.Sleep(20);            ChipSelect.Write(false);            Thread.Sleep(20);            //common color and colon stuff            int ColorAndColon1 = ((int)Color.Red << 4) + ((int)Colon.Upper << 2);            int ColorAndColon2 = ((int)Color.Cyan << 4) + ((int)Colon.Lower << 2);            int ColorAndColon3 = ((int)Color.Yellow << 4) + ((int)Colon.Both << 2);            int ColorAndColon4 = ((int)Color.Magenta << 4) + ((int)Colon.None << 2);            //write '7654'            bufOne[0] = (ushort)ColorAndColon1;            bufOne[0] <<= 8;            bufOne[0] |= 64;            bufTwo[0] = (ushort)ColorAndColon2;            bufTwo[0] <<= 8;            bufTwo[0] |= 32;            bufThree[0] = (ushort)ColorAndColon3;            bufThree[0] <<= 8;            bufThree[0] |= 16;            bufFour[0] = (ushort)ColorAndColon4;            bufFour[0] <<= 8;            bufFour[0] |= 8;            Spi.Write(bufOne);            Spi.Write(bufTwo);            Spi.Write(bufThree);            Spi.Write(bufFour);            ChipSelect.Write(true);            Thread.Sleep(Timeout.Infinite);        }     }   }



#54615 "Intelligent Systems Competency:" Embedded only, or MF too?

Posted by remotewizard on 11 December 2013 - 09:59 PM in General Discussion

Sorry if this has been covered before!

 

Microsoft is rolling out a new 'Intelligent Systems Competency' for partners sometime in Q12014.  From the announcement:

 

"As an extension of our cloud commitment, the Intelligent Systems Competency will also launch to enable partners to capitalize on the fast growing opportunity related to the "Internet of Things," and other competencies will have requirement updates to account for new exams to ensure you are confident selling and implementing the newest versions of Microsoft products and services. "

 

Right now, everything points to the Windows Embedded folks. Might there be a role for .NET MicroFramework (and our beloved Netduino) as well?




#54633 "Intelligent Systems Competency:" Embedded only, or MF too?

Posted by remotewizard on 12 December 2013 - 02:11 PM in General Discussion

I'll email them as well. Thanks for the great suggestion!




#56915 Dedicated clock CPU vs thread on an N2+?

Posted by remotewizard on 19 March 2014 - 02:54 PM in General Discussion

Work continues (slowly!) on my Nixie clock project.  Currently, it includes the following parts:

 

  • a conventional Windows service (running on an existing always-on PC) that periodically obtains the local weather forecast from Forecast.io, parses the results, and posts the one-word forecast for the next day to Xively
  • one (so far) Electric Imp with an Adafruit AM-2315 I2C temperature/humidity sensor, which will eventually reside outdoors; this periodically posts the current temperature and humidity to Xively
  • My Netduino (attached to an Edimax BR-6258n for WiFi access) running an MQTT client, subscribing to the forecast, temperature and humidity info on Xively.  When new data is received, the appropriate global variables are updated and action taken 
  • a lookup table on the Netduino that converts the one-word forecast ("snow") to a color ("white"); think the Gulf Building weather beacon in Pittsburgh, where lighting on the the top of the building changes color with the weather forecast.
  • currently, a tricolor LED to display the forecast color.  In the future, when I install my four DFRobot Nixie modules, I'll control the background colors of those instead
  • a RTC synced to NTP (currently by the Netduino), with an automatic adjustment for Daylight Savings time
  • finally, the four Nixie tubes which will display the clock time on request (I'll normally keep the neon part powered off, to increase the tube's lifespan.

 

It seems like a waste of the Netduino to run as a simple realtime clock, constantly updating the Nixies via SPI; I'd like to eventually add additional functionality to the Netduino (e.g. local room temperature sensor, smoke detectors, etc.) and don't want to burden the Netduino with gruntwork.  Would I be better off to move the strictly clock-related functions off to something like an ATTiny (or dedicated time clock chip), reserving the Netduino for more complex tasks?  Or am I worrying needlessly (as I often do)?

 

Did any of this make any sense at all?




#57018 Dedicated clock CPU vs thread on an N2+?

Posted by remotewizard on 23 March 2014 - 12:18 PM in General Discussion

I was hoping that would be the case, but it's nice to know for sure.  Thanks for taking the time to reply!




#57156 Adafruit Ultimate GPS with N+2. Any experiences?

Posted by remotewizard on 26 March 2014 - 10:14 PM in Netduino Plus 2 (and Netduino Plus 1)

I just received my Adafruit Ultimate GPS today.Based on your experience, I attached a 3.7v LiPo to Vin and Ground, stuck it on a windowsill, and went to have lunch.  By the time I got back, it had a lock. I then moved it to my N2+ and it locked within 30 seconds (location masked because I'm just paranoid):

 

3D-Fix: True, Sattellites: 6, Time: 03/27/2014 22:04:33, Latitude: 4XXX.4XXX,N, Longitude: 09XXX.1XXX,W, Altitude: 290.9,M, Knots: 0.579999983 (1.13215995 km/h)

 

This is with the backup battery installed and the internal antenna only.  I'm using the NmeaGps class from the NetMFToolkit.

 

So far, so good.  Any chance you might have a defective unit?




#57166 Adafruit Ultimate GPS with N+2. Any experiences?

Posted by remotewizard on 27 March 2014 - 12:00 PM in Netduino Plus 2 (and Netduino Plus 1)

I hadn't tried moving it around the house.  If I get a chance over the weekend, I'll take my Netduino for a drive (I'm logging GPS changes to my SD card) and see what happens.




#57168 Adafruit Ultimate GPS with N+2. Any experiences?

Posted by remotewizard on 27 March 2014 - 12:40 PM in Netduino Plus 2 (and Netduino Plus 1)

I'll try that too.





home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.