Easy multiplexing with the Netduino
#21
Posted 20 August 2011 - 10:47 PM
Iam trying follow your tut. Inputs alone works fine (added Debug.Print(PinId.ToString()); to interrupt methods, and the pointer is right). Outputs works only if i disconnect clock wire between output and input IC's.
Iam using simple loop to test outputs:
int cnt = 0;
while (true)
{
Leds[cnt].Write(true);
Debug.Print(cnt.ToString());
Thread.Sleep(1000);
Leds[cnt].Write(false);
cnt++;
if (cnt > 15) cnt = 0;
}
Everything is ok when clock wire goes only on output IC's, but when is connected farther to input IC's, the first output (Qa) on both 74HC595 is stil in 1 (ON) and the bits are shifted (Leds[0].Write(true); turns Qb, Leds[1].Write(true); turns Qc .....).
Here is video with clock disconnecting: Youtube
(the connection is checked milion times).
Thx for any suggestions.
#22
Posted 21 August 2011 - 07:41 AM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#23
Posted 21 August 2011 - 08:48 AM
Stat's strange, since the clock wire is only outgoing from netduino. I can't think of a reason causing this.
But I do know (dis)connecting clock or one of the data lines while the program runs, the shifter IC's gets 'confused' since it probably misses a few bits. Do you have your IC's connected to +5V or +3.3V?
Also, which pins did you use as latch/chip select pin? I know pin 4 has some timing issues.
+5V my fault. 3,3V works nice. Thanks for your help.
#24
Posted 21 August 2011 - 08:57 AM
Glad to read that! I had the same issue once.+5V my fault. 3,3V works nice. Thanks for your help.
The IC's work on 2.5 to 6V, but since the clock and datalines from the netduino are 3.3V it can give troubles when you connect them to 5V. At least, I thought that's the case.
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#25
Posted 21 August 2011 - 03:35 PM
#26
Posted 22 August 2011 - 07:35 AM
I shall look at it soon. It's one of my first netduino schematics so it could contain some mistakesStefan, the supply voltage of the external logic should not be a problem. The HCMOS chips work well with the high level below the nominal supply. However, the min threshold must be below the Netduino high-level (3.3V).
Instead, I took a peek at the sources.
About the HC595, you should set the SPI config with both "Clock_IdleState" and "Clock_Edge" to true. This because the SPI guarantees the stable data on the MOSI pin when the clock is rising, and changes it on the other edge.
Probably the circuit is working at the limit, and when the power is +5V the troubles are evident.
I already gave that some thought and driving it correctly should require an additional NOT component I suppose. The funny thing is, you suggested the current setup hereOn the other side, neither the HC165 is properly driven, IMHO.
The HC165 shifts on the rising edge of the clock, but the SPI is also sampling the MISO pin at the same time. This easily leads to an aleatory value.
Moreover, you should drive the PL pin. How can you take a "snapshot" of the parallel inputs otherwise?
Cheers
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#27
Posted 22 August 2011 - 03:23 PM
Unless I misinterpret your directive on how to connect the HC165, my intention was and still is to drive the PL pin using an OutputPort of the Netduino.The funny thing is, you suggested the current setup here
At this point I must ask a question, because I cannot make experiment here (I'm on vacation), and I don't remember what is the current SPI limitation. The PL pin could be driven "manually", by using any OutputPort to create a pulse (low). That pulse freezes the current state of the HC165 inputs to the shift register. It acts much like the button of a camera: you must pull it low to take a snapshot.
Well, it would be nice that it will be driven automatically by the SS output. This could improve the SPI performance, and get a cleaner code (and simpler as well). So, until the /PL is low, there's no way to shift any data. Thus the /PL should be NORMALLY low, and tied high when the SPI asks for the transfer. This is surely allowed by the SPI config, but it is complementary to the HC595 SS schema.
My question is: the current SPI implementation allows to create to different SPI configs, so that the HC595 and the HC165 could be hosted together, in the same app?
If so, that schema should be better.
If you may perform any test, feel free to tell me any news about it.
I told you, I am spending ten days in Suedtirol...(HEAVEN!)
Cheers
#28
Posted 22 August 2011 - 03:32 PM
EnjoyI told you, I am spending ten days in Suedtirol...(HEAVEN!)
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#29
Posted 06 September 2011 - 11:52 PM
Iam back with news.
3.3V works nice, so i made little 8x8 (1 Output = 1 LED) display from 74HC595 ICs, video here.
Than I start with scrolling text, so I expand display with another same display connected in to series (16x 74HC595) and problem with first bit is back.
First of all I thought its because netduino power supply cant handle too much ICs and LEDs, so I took down LEDs from one of these displays (only ICs connected) and it was same, than i used external 3.3V (from ATX supply connected over opto couplers), but this not solved the problem.
Youtube video with problem is here. The problem starts when is second diplay connected to series (same with parallel). Multimeter shows voltage between Vcc+SRCLR (3.3V) and GND pins. Interesting is that problem disappear when i pull this voltage down, or disconnect Vcc, but "brightles" is decreased.
O_o cool i solved problem while writing this post. Just put small 220ohm (27ohm was too small) between pin 11 and first IC serial (SER) input pin (yellow wire on stefans fritzing). Dont ask me why, but works (only 3.3V. 5V makes another anomaly, some characters in text have missing parts)
Tomorrow I will make some videos of displays and add links here:
- Gutworks likes this
#30
Posted 07 September 2011 - 04:03 AM
#31
Posted 07 September 2011 - 07:36 AM
I'm curious! I set up this project but you have much more knowledge about this.I'll post some considerations after the Stefan's answer...
I haven't found issues with the 74HC595 schematics, only with the 74HC165, which I'm trying to look into.
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#32
Posted 07 September 2011 - 08:18 AM
In the 595 SPI config, the ClockEdge is set to false, but it must be set to true.
Read my example on the Wiki, and it will be clear.
Exanko was able to get the circuit working with two "tricks":
- keeping the power supply low enough (at 5V the circuit is not working properly);
- placing a (small) resistor in series to a wire.
Both the above tricks contribute to "delay" the signal respect to the clock. Since the clock is phased out of 180', a little delay re-phases the datum respect to the clock edge.
Still not finished to comment, but at the moment I have no time.
#33
Posted 07 September 2011 - 08:21 AM
Mario, I want to thank you for your help so far, and hopefully in the futureStill not finished to comment, but at the moment I have no time.
I am currently revising a lot of code and schematics at home (and working on VB-versions) and going to correct this in the next version. Going to look to the wiki tonight since I also have little time.
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#34
Posted 10 September 2011 - 05:57 AM
Thanks so much for posting this code. I used it to do a simple 8 button multiplexing test.
http://10rem.net/blo...th-the-netduino
Pete
I work for Microsoft. Opinions expressed here are my own and do not necessarily reflect those of my employer,our partners or customers.
#35
Posted 10 September 2011 - 06:38 AM
#36
Posted 10 September 2011 - 08:15 AM
Please don't solder your project just yet@Stefan
Thanks so much for posting this code. I used it to do a simple 8 button multiplexing test.
http://10rem.net/blo...th-the-netduino
I've been working on improving the 74HC165 schematics which will probably be posted somewhere after my vacation (~26sept)
There are some performance issues with it. The 74HC595 schematic is OK but code can require some tweaks too.
For the LCD, try the attached Ic74HC595LcdProvider-class, together with this: http://geekswithblog...id_crystal.aspx
It's a tryout of myself which helps linking the LCD classes with other 74HC595 chains. I succeeded to drive multiple LCD's on one latch pin with it.
Attached Files
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#37
Posted 13 September 2011 - 04:38 PM
- Riny likes this
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#38
Posted 23 September 2011 - 02:56 AM
Attached Files
#39
Posted 23 September 2011 - 03:51 AM
Great idea making a PCB: it was a long time project, but none even started it.
Well, about the schematic, it seems okay. I didn't check the PCB, though.
I'd tell my opinion, and I'd love other people add their suggestions, so that you may finish the project.
- I'd use the positive logic for the leds. For the HCMOS chips there's no difference if you drive at high or low level, so I'd vote for the most intuitive polarity.
- I'd make the shield "chainable", at least for the 595, so that the users may chain several shields, and driving many leds. I wouldn't see the necessity to chain more 165s.
- I'm still uncertain whether is better to create a single shield for inputs and outputs, or create two different shields. It may depend on the PCB cost.
- In the "chainable" context, it would be nice that the user may use connectors, instead of wiring several shields together. I suppose the wiring is tedious.
Don't forget to add how much will cost the PCBs.
Cheers
#40
Posted 23 September 2011 - 06:49 PM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users