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

Direct Port IO


  • Please log in to reply
7 replies to this topic

#1 lazarus

lazarus

    New Member

  • Members
  • Pip
  • 2 posts

Posted 06 May 2012 - 05:28 PM

Hi, is there a faster way to switch digital output pins on and off? On arduino there is something called direct port IO that allows for a lot faster switching. Is there something similar on netduinio? The reason I'm asking is that I'm trying to generate a 38khz digital signal for IR. However when i simply toggle a pin on and off in a loop I get a speed of aprox 9khz. This is nowhere near the 38khz signal I'm looking for. Thanks for any directions... BTW, I'm new to netduino and as a .NET developer I love it!

#2 MDS

MDS

    Member

  • Members
  • PipPip
  • 16 posts

Posted 06 May 2012 - 08:43 PM

Have you tryed the Pulse Width Modulator. Thats the type of thing the PWM is designed for.

#3 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 06 May 2012 - 09:29 PM

Hi lazarus, Welcome to the forums! As MDS suggests, PWM might get you a 38kHz signal. But, do you need to modulate it? If you do, you might want to experiment with using the SPI data out "MOSI" signal. I am not sure about this, but I think you should be able to set up an array of words of data that when output serially will give bursts of pulses that are equivelant to modulating a 38kHz clock. Two things I am unsure about are whether you can get the exact clock speed, and whether the Netduino clocks the data out in a continuous stream, or several bursts. The clock speed issue may mean you have to use a higher clock speed and use several data bits per 38 kHz baud period. However, if the data is output in bursts, this will defeat the method. Have fun experimenting - Paul

#4 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 07 May 2012 - 05:19 AM

The PWM is not the right component for modulating a signal, at least if you need a relatively high speed.

Instead, if you need a modulation for infrared data (IR), Paul has got it: the SPI is the right choice.
I have successfully created a library for IR protocols. At the moment of writing there are three protocols fully working: Philips RC-5, Lego, Sony.

Have a look here: http://highfieldtale...r-for-netduino/
and here: http://blogs.msdn.co...red-part-1.aspx

Cheers
Biggest fault of Netduino? It runs by electricity.

#5 lazarus

lazarus

    New Member

  • Members
  • Pip
  • 2 posts

Posted 08 May 2012 - 11:33 AM

Thanks all for the insights! I indeed forgot to mention that I need to modulate the signal. I'll give the SPI a go to send out IR. Thanks again

#6 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 08 May 2012 - 12:59 PM

The maxim MAX3100 can be used as an IRDA modulator, quite easy to get going using SPI and is available is a DIP package so dead easy to bread board a test circuit although this assumes you want to use serial comms. I suspect Mario's article may be more applicable for your needs.

#7 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 08 May 2012 - 01:20 PM

The maxim MAX3100 can be used as an IRDA modulator, quite easy to get going using SPI and is available is a DIP package so dead easy to bread board a test circuit although this assumes you want to use serial comms. I suspect Mario's article may be more applicable for your needs.


The MAX3100 is a good UART that can be driven via SPI. It's useful whereas you need more UARTs than the MCU can offers to you.

BTW, Lazarus seems asking for generating IR signals for remote commanding home appliances, such as TVs, Hi-Fi sets, etc. In this case the protocols are very different from the UARTs.
My solution is much like an hack to play with Netduino. A much better solution would be using any low-price MCU (e.g. AVR, STL, etc), programmed so that you can use everywhere. I guess that could be a nice project for the Go! as well.
Cheers
Biggest fault of Netduino? It runs by electricity.

#8 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 08 May 2012 - 03:32 PM

The MAX3100 is a good UART that can be driven via SPI. It's useful whereas you need more UARTs than the MCU can offers to you.

BTW, Lazarus seems asking for generating IR signals for remote commanding home appliances, such as TVs, Hi-Fi sets, etc. In this case the protocols are very different from the UARTs.
My solution is much like an hack to play with Netduino. A much better solution would be using any low-price MCU (e.g. AVR, STL, etc), programmed so that you can use everywhere. I guess that could be a nice project for the Go! as well.
Cheers


Yeah the MAX3100 would be no use for a IR interface for AV gear etc.

Think that would indeed make a very nice GO! project, maybe see if implementing a learning mode would be practical, if nothing else with a net connection could make for a very good prank device, i.e. remotly turn off TV etc. ;), and im sure there must be thousands of home automation projects that could benefit from IR transceivers...




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.