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.
Photo

I become crazy because wiring?


  • Please log in to reply
29 replies to this topic

#21 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 28 October 2011 - 11:49 AM

Dops, I want anything but hurting you!...Your desperation is very common when you make experience: I share it!
Capita spesso anche a me! (=it happens often to me as well)

Please, could you try to use the very basic SPI way?
Here is the sample configuration:
http://wiki.netduino...figuration.ashx

To set the leds output, use this:
ushort x = 0x55AA; //bitwise array
xspi.Write(x);
I'll stay in touch.
Cheers
Biggest fault of Netduino? It runs by electricity.

#22 dops

dops

    Member

  • Members
  • PipPip
  • 28 posts

Posted 28 October 2011 - 03:23 PM

Dops, I want anything but hurting you!...Your desperation is very common when you make experience: I share it!
Capita spesso anche a me! (=it happens often to me as well)

Please, could you try to use the very basic SPI way?
Here is the sample configuration:
http://wiki.netduino...figuration.ashx

To set the leds output, use this:

ushort x = 0x55AA; //bitwise array
xspi.Write(x);
I'll stay in touch.
Cheers


Ok this is the result:
Attached File  WP_000148.jpg   103.76KB   23 downloadsAttached File  WP_000150.jpg   106.62KB   22 downloads
Really i think problem is current voltage.. I don't know other explanations :(
If i use 3V pin, doesn't turn on even a single LED..
I begin to think that an electrical appliance is teasing me :( :angry:

This is used code:

        private static SPI SPIBus;


        public static void Main()
        {
            // Defines the first SPI slave device with pin 10 as SS  

            SPI.Configuration Device1 = new SPI.Configuration(

                Pins.GPIO_PIN_D10, // SS-pin  

                false,             // SS-pin active state  

                0,                 // The setup time for the SS port  

                0,                 // The hold time for the SS port  

                true,              // The idle state of the clock  

                true,              // The sampling clock edge (this must be "true" for the 74HC595)  

                1000,              // The SPI clock rate in KHz  

                SPI_Devices.SPI1   // The used SPI bus (refers to a MOSI MISO and SCLK pinset)  

            );

            // Initializes the SPI bus, with the first slave selected  

            SPIBus = new SPI(Device1);

            DoWorkSlow();

         



        }
        private static void DoWorkSlow()
        {

            //set-up a one-byte buffer  

            byte[] buffer = new byte[1];

            while (true)
            {

                for (int i = 0; i < 8; i++)
                {

                    buffer[0] = (byte)i;

                    SPIBus.Write(buffer);

                }

                Thread.Sleep(500);

            }

        }


#23 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 28 October 2011 - 03:49 PM

No: the code is not the same I suggested. Your's is displaying sequentially the numbers from 0 to 7, but since they're in fast sequence, you will see only the "7". The "while" is okay, but avoid the "for" loop. Then use the "ushort" buffer, that shifts a word at once.
Biggest fault of Netduino? It runs by electricity.

#24 dops

dops

    Member

  • Members
  • PipPip
  • 28 posts

Posted 28 October 2011 - 04:33 PM

No: the code is not the same I suggested. Your's is displaying sequentially the numbers from 0 to 7, but since they're in fast sequence, you will see only the "7".
The "while" is okay, but avoid the "for" loop. Then use the "ushort" buffer, that shifts a word at once.

Sorry, i don't understand
ushort x = 0x55AA; //bitwise array 
xspi.Write(x);
isn't possible.. simple because xspi.Write() method accept only arrays of type byte[] and ushort[]
:(

#25 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 28 October 2011 - 05:13 PM

You're right: my mistake.
Two options:
ushort[] buffer = new ushort[] { 0x55AA };
or:
byte[] buffer = new byte[] { (byte)0x55, (byte)0xAA };
Try now.
Biggest fault of Netduino? It runs by electricity.

#26 dops

dops

    Member

  • Members
  • PipPip
  • 28 posts

Posted 28 October 2011 - 06:12 PM

You're right: my mistake.
Two options:

ushort[] buffer = new ushort[] { 0x55AA };
or:
byte[] buffer = new byte[] { (byte)0x55, (byte)0xAA };
Try now.

In fact I had already tried, nothing to do, always the same problem :(
I've changed breadboard.. but nothing.. :(

#27 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 29 October 2011 - 03:58 AM

I assume you don't own neither a scope, nor a multimeter...
Biggest fault of Netduino? It runs by electricity.

#28 dops

dops

    Member

  • Members
  • PipPip
  • 28 posts

Posted 29 October 2011 - 07:29 AM

I assume you don't own neither a scope, nor a multimeter...

My uncle has a scope, try to go to make measurements.. :( uff!! (capitano tutte a me!!)

#29 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 29 October 2011 - 07:36 AM

Cheer up, Dops...this is funny: inspecting and digging into a trouble...not when everything goes right at first time! Within minutes I leave for Rome, I'll be in touch later or tomorrow... Cheers
Biggest fault of Netduino? It runs by electricity.

#30 dops

dops

    Member

  • Members
  • PipPip
  • 28 posts

Posted 29 October 2011 - 04:54 PM

Cheer up, Dops...this is funny: inspecting and digging into a trouble...not when everything goes right at first time!

Within minutes I leave for Rome, I'll be in touch later or tomorrow...
Cheers

yes it's ok, maybe funny, but not in this type of situation, i mean this is a simple circuit.. what happen when i make more complex circuits? .. see you, and thank you ;)
(ti stai avvicinando dalle mie parti, io sono di napoli) :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.