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

Analog Output signal with Netduino


  • Please log in to reply
2 replies to this topic

#1 Frederik Prijck

Frederik Prijck

    Member

  • Members
  • PipPip
  • 17 posts
  • LocationBelgium, Ghent

Posted 27 November 2012 - 10:09 PM

Hi guys, I'm not sure if code questions belong here... I recently started toying around with my netduino plus 2! Cool stuff, but I'm trying to find my way around the basics. Now, my girlfriend is using her arduino for some kind of school project and I was trying to control a DC motor the same way she is doing... http://pastebin.com/WgyHbeuL Basicly what she is doing is writing values from 0 to 255 and back to 0... (she is not 100% sure whether that is the way it is supposed to be done... But that does not change my question) With NetDuino I know we can write true or false using digital output, but for sending the values mentioned above I do not see any kind of way... I tried googling around for PWM but I can't seem to understand whether PWM is the right direction... If it is, how would I achieve this? This may be a very basic question, I'm sorry :(

#2 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 27 November 2012 - 10:57 PM

first: i the stm32f4 has 2 analog outputs, but they are not exposed in the go/plus2 as far as i know. so you have tu use pwm. pwm fits perfect for motor control (and i dont see it working with analog out ?! it has way too less power to drive anything other than a led) its like that: you connect a pwm output pin to a resistor (like 2kohm+) to a transistors base. now if the transistor is strong enuff he can drive a motor, or he can drive a mosfet. software side you set your pwm up to something like: frequenzy = 1000hz, and than change the duty cycle. 1.0f = 100% on, 0.5f = 50% on and so on. you finde more on this when you search for led dimming per pwm //edit: what pwm means: with 1000hz you split a second into 1000 pieces, and the duty clyce says for how long each of this pieces is turn on. so with 0.5f it would make 1000 steps and every step if 50% of the time on and 50% of the time off, resulting in a total of 500msec per sec

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 November 2012 - 09:22 AM

Hi NooM,

first: i the stm32f4 has 2 analog outputs, but they are not exposed in the go/plus2 as far as i know.

The DAC on STM32F4 is not 5V tolerant, so we weren't able to expose it on Netduino Plus 2. We wanted to make sure users don't damage their mainboards when plugging in Arduino shields.

With Netduino Go, we are supporting the AnalogOuput (DAC) class on GoBus modules. The Gadgeteer Adapter module will support DAC, and hopefully some other 3rd-party modules will as well.

Chris




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.