MCU with usb and C# gui

Go To Last Post
51 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I am a beginner in the MCU world. 

The problem is: i have a temp sensor with a 10-bit digital output.(sorry i can't share the sensor because it is not my design but from a friend)

This 10-bit sensor needs to read out and the temp must be shown on a pc program(C#)

 

My first idea was to use an avr. After that i was looking how to connect an usb interface to it and i found v-usb.

All the forums of v-usb are very old, so i thought maybe there is a new alternative which is better. I can't find it.

 

So what is the best thing to do?

 

thanks a lot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

soepblikje wrote:
I am a beginner in the MCU world. 

So do you have any experience of programming in general?

And 'C' programming in particular?

 

How is your basic electronics?

 

soepblikje wrote:
So what is the best thing to do?

Nowadays, the obvious answer would be to use an Arduino.

 

In general, the simplest approach will be to just use the AVR's UART to transmit the data, and use an off-the-shelf USB-to-Serial converter to connect to the PC; eg,

 

Image result for ftdi rpi

 

As far as the PC program is concerned - whatever language it's written in - it's just a matter of receiving data from a COM port.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have worked a lot with C so that would not be a problem.

I want to make a nice small pcb for the sensor so i don't want to use the Arduino.

My basic electronics are oke!

 

I am going to look at the uart possibility 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are some very small Arduinos!

Adafruit Adafruit Trinket - Mini Microcontroller - 5V Logic

 

But, if you really want to go for a "bare" AVR, then get an XPlained Pro, Mini, or Nano to develop on:

 

https://www.avrfreaks.net/comment...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:
i have a temp sensor with a 10-bit digital output.(sorry i can't share the sensor because it is not my design but from a friend)

 

Only 10 bit, like an LM70?

 

Arduino Nano's make a great development platform, you can always shrink it after the initial design is done and you know how much space is needed for the app.

 

Good luck and come back if you need any help or suggestions.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

V-USB is a "good trick" but if you are designing USB in from the start I'd do it properly. Either get an AVR that has a USB interface (downside no DIP packages) or just like Arduino put a chip that will convert UART to USB between AVR and PC. That can (often does) mean a $2 USB - TTL cable from ebay.

Last Edited: Fri. Feb 23, 2018 - 02:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do i also need to add a crystal oscillator for the uart option? I can't find it

 

second problem uart is only 8-bit:(

Last Edited: Fri. Feb 23, 2018 - 05:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

soepblikje wrote:
second problem uart is only 8-bit:(

What do you mean by that?  Surely you are going to create a multi-byte message for your communications...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:
Do i also need to add a crystal oscillator for the uart option?

For reliable serial comms a crystal is strongly recommended. The forum is awash with posts about serial comms problems without a crystal.

 

You don't need a crystal oscillator - just a crystal. See: https://www.avrfreaks.net/comment...

 

second problem uart is only 8-bit:(

Why is that a "problem" ?

 

A PC's COM port is only 8-bit ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

FTDI makes a number of "USB cables" with TTL-level interface at the far end. They are dead-easy to connect to an MCU UART. There are versions for 5V logic and others for 3V3 logic. 

 

Here is an example of one for 3V3 logic and with a 6 position square-pin header at the far end:

 

https://www.mouser.com/ProductDe...

 

They are a bit spendy (about 20USD) but when you compare the work it takes to do a 1-off USB interface, its not bad, at all.

 

Jim

 

 

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
They are a bit spendy

They are - but they do work, are well-documented and supported.

 

I find the price to be good value - to get a good, solid product.

I have never had trouble with FTDI stuff.

 

Much cheaper versions are available on the likes of ebay.

 

I certainly have had trouble with cheap  USB adaptors.

 

You pays your money, and you takes your choice ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Important attribute for those  things: no special hardware and no special code. Direct connect to UART and standard UART code. For me, in a one-off situation, that can be worth a lot. As quoted in Johan's tag line (paraphrased) "We don't lack stuff. We do lack time."

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Only 10 bit temperature resolution ?

 

Check out BMP180 it is a temperature sensor with a 0.002 deg. Centigrade or so resolution. Absolutely redcilous.

And it comes in a package that's almost inivisibly small..

Oh, I almost forgot. This thing can also measure air pressure.

 

Hint:

A lot of the "modern" sensors have a built in temperature measurement capability, which is there to be able to callibrate it for temperature differences.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paulvdh wrote:
A lot of the "modern" sensors have a built in temperature measurement capability

Very true.

 

Also many processors - although they are more likely to differ from ambient temperature due to the processor's operating heat.

 

On a recent project, I think there were 3 different temperature measurement options ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paulvdh wrote:

Only 10 bit temperature resolution ?

 

Check out BMP180 it is a temperature sensor with a 0.002 deg. Centigrade or so resolution. Absolutely redcilous.

And it comes in a package that's almost inivisibly small..

Oh, I almost forgot. This thing can also measure air pressure.

 

Hint:

A lot of the "modern" sensors have a built in temperature measurement capability, which is there to be able to callibrate it for temperature differences.

 

yes i understand but he made the temperature sensor on his own with an adc converter to 10-bit output

 

And i want to build for me to practice a solution to send those 10-bit to a pc and build a c# interface next to it

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:
... and build a c# interface next to it
If Windows 10

https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/SerialArduino#serial-arduino-sample

Serial Arduino sample

Shows how to use the Windows.Devices.SerialCommunication APIs to communicate with an Arduino device.

...

that mentions UWP so might be able to run it on an Xbox.

 


Microsoft logo

Microsoft

Developer

Microsoft Windows USB Core Team Blog

What is new with Serial in Windows 10

by George Roussos [Microsoft]

July 29, 2015

https://blogs.msdn.microsoft.com/usbcoreblog/2015/07/29/what-is-new-with-serial-in-windows-10/

...

 

2.   A Windows Runtime API for communication with Serial devices

...

Windows 10 SDK includes two Universal SDK samples illustrating this API:

...

2. New SerialArduino SDK Sample from above //build talk is now available including C# and Arduino sketch source code.

 

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, so what is the format those 10 bits are transmitted? SPI? Parallel? I2C?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As far as transmitting that data to the PC (the topic of this thread) it is irrelevant how the data gets into the microcontroller.

 

It is also irrelevant that it comes from a temperature sensor.

 

As far as transmitting to the PC goes, it's all just data.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, sure, but when the OP said the UART being 8 bits is a problem, that got me wondering if he actually knows how to get the data into the MCU. He's a beginner after all.

Last Edited: Sat. Feb 24, 2018 - 10:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see - fair point.

 

But #8 and #9 have already raised the point that this should be no problem - the OP's response is awaited ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yeah i read a lot last day and i know what to do now. The only thing that is not clear for me is why the crystal must be added? The internal oscillator is fast enough for uart, but iread it is a bit more unstable. Is this really a problem?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Yes, it really can be a problem. The issue is this. When UARTs are used for communication, the maximum speed difference is about 4%. Above this, many characters will be incorrectly received. Usually, this is translated into a tolerance of 2%. With this tolerance, it is possible to have an error of +2% on one end and -2% on the other, and you would be at that 4% difference limit.

 

Now, we get to the core issue. Uncalibrated, the internal clock in most AVRs have, I believe, about a 5% tolerance specification. That does not mean that every one has that much error, but any can. Thus, you never know what you will have. The solution is so simple. Just use a crystal (and two small capacitors); crystals will typically give you much better than 0.1% accuracy. You can also use an appropriate ceramic resonator; these will usually save you the capacitors that are needed with a crystal. Many (but not all) resonators are now specified at better than 2%. To use either a crystal or a resonator, you will need to set the device fuses appropriately. 

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:
i read it is a bit more unstable.

Not so much that it's unstable - more its accuracy.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But, the error is cumulative. So the first bits have more chance to be error free than the last ones. Since you need to transmit 10 bits, it will have to be done in two bytes anyway, so I would transmit 5 in the first and 5 in the second, this will probably increase the tolerance to 5 or 6%.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's pretty easy to adjust the internal RC oscillator by tweaking the frequency adjustment register.  I don't know about the Mega, but the Xmega 32kHz RC osc. is supposed to have an error less than 0.5 % right out of the box.  That oscillator is used with DFLL to give the other RC oscillators the same error.

 

If you use an Xmega I could give you some software to do it,  but at the moment I'm working on another project.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are a couple very-small supported-by-arduino boards with hardware USB support.

The "teensy 2" from PJRC was probably first, and there are now several lower-cost 32u4-based boards from various sellers like Adafruit.
PJRC Teensy 2

 

Adafruit "itsy bitsy 32u4"

 

 

And I have a couple of these SAMD11 boards, which are even smaller...

Dixi SAMD11 board

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17 wrote:
It's pretty easy to adjust the internal RC oscillator by tweaking the frequency adjustment register.

But wouldn't you then also need to keep adjusting for temperature (and supply voltage?) changes ?

 

The whole point is that it's trivial to just use a crystal.  Then it will just work - there's no uncertainty, and no need to faff about with this stuff at all.

 

Sure, if you were making millions, then shaving the few cents off could be worthwhile - but not for a beginner hobbyist 1-off.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

steve17 wrote:

It's pretty easy to adjust the internal RC oscillator by tweaking the frequency adjustment register.

 

But wouldn't you then also need to keep adjusting for temperature (and supply voltage?) changes ?

 

The whole point is that it's trivial to just use a crystal.  Then it will just work - there's no uncertainty, and no need to faff about with this stuff at all.

 

Sure, if you were making millions, then shaving the few cents off could be worthwhile - but not for a beginner hobbyist 1-off.

 

Yes and no.  The crystal seems like a good solution.  But in case your board doesn't have one, there are other ways to achieve success.  

 

The 32kHz RC osc. on the Xmega is the "master clock" that can control the frequency of the other oscillators.  It's quite good for an RC osc.  It's frequency only varies by 1% when the temperature varies from -40C to +40C (according to the data sheet).  I'm not familiar with how the frequency varies with voltage changes because my boards lately have been powered by USB 5 V "VBUS".  

 

Then there is USB SOF.  When attached to the host USB, the Xmega can use the USB "start of frame" (SOF) signal to control the Xmega clocks.  Apparently the SOF is quite accurate.  The Xmega can acquire and use SOF even when the original Xmega frequency is way out of spec before attaching.  I've tried it when the original Xmega frequency was 15% off and it worked like a charm.

 

I keep mentioning the Xmega because that's the only chip I'm familiar with.  There are no doubt other chips that work the same way.

 

 

Last Edited: Sun. Feb 25, 2018 - 12:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

oke! nice, i understand the idea behind it now:)

 

i am looking to integrate a usb to uart bridge on the pcb. I found the FT232RL but it is kind of a big component. Are there smaller versions of the FT232RL?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look at all the USB-TTL converters on eBay and the chips they are based on. They are all the cheaper alternatives to FT232.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check out the CP2102N from Silicon Labs, for example. It comes in pretty small packages. https://www.silabs.com/products/...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:
FT232RL but it is kind of a big component.

Eh??

 

The QFN32 is 5mm x 5mm !

 

http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf - see p37

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you are right hahaha......  i think i am going to use it and make a nice usb input port on my pcb:)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are there smaller versions of the FT232RL?

 I just bought some CH340E *MODULES* that are 16x16mm, and include connectors and LEDs.   At $1 each, I may never consider a chip-level solution again.

 

Even if you want to stick with FTDI, the FT232 is essentially a "legacy" chip ; There are newer, smaller, cheaper, and less widely counterfeited chips like the FT230X and FT231X.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well I don't know your situation.  I would use an AVR with built-in USB.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes that would be the best, but there are no dip versions as i know, so that is a problem.

i also need to learn soldering and smd looks prety difficult haha

Last Edited: Mon. Feb 26, 2018 - 02:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:
yes that would be the best

But you said you're a beginner - getting an embedded USB Stack up & running is not a beginner project!

 

there are no dip versions as i know, so that is a problem

And yet you're thinking of using QFN chips for USB-to-UART ?!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yup, first the OP says the FTDIs are "too large", now he wants to use DIP? Doesn't make sense...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for your reaction.

 

yeah i am trying to find out all the possible solutions for a problem and investigate what is possible.

I am trying to explore this world so I like to see all the possibities. I have took a step forward to see if onboard usb port is possible. I think it is too difficult for me because of smd parts.

So now i am going back to my first plan and using the uart to usb cable. It is not the most beautiful solution, but for me now it is the best solution.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you use an Xmega, I can give you my USB code.  It comes with a double your money back guarantee if it doesn't work.smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am watching smd soldering tutorials at the moment. I am not very good in fine motor skills haha so i don't know if i will succeed in that 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17 wrote:
I would use an AVR with built-in USB.
This has to be a tempting option surely? Have you weighed up the cost of AVR+CDC_converter versus AVR+built_in_USB ? If board area is a premium then this has to help with that too doesn't it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Last Edited: Mon. Feb 26, 2018 - 04:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:

i need this: 

http://www.evbplus.com/TinyUSB_9...

 

 

Why not use one of these?  https://www.aliexpress.com/item/...

 

 

Jim

 

Edit: added aliexpress link

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I understand this is the easiest way but i want to learn pcb design my own so this is boring haha.

But I know what to do now 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SMD soldering is actually a lot easier than it seems. In my opinion, the most important component is a good flux.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

at five times the price is Teensy 2.0 though with HalfKay bootloader, open source command-line multi-platform Teensy Loader, USB virtual serial source code, Teensyduino IDE, and it's in PlatformIO.

PJRC
PJRC Store  Teensy 8 bit  Teensy 2.0 Pins

https://www.pjrc.com/store/teensy_pins.html

https://www.pjrc.com/teensy/loader_cli.html

https://www.pjrc.com/teensy/usb_serial.html

https://www.pjrc.com/teensy/teensyduino.html

http://docs.platformio.org/en/latest/platforms/teensy.html

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:
I understand this is the easiest way but i want to learn pcb design my own so this is boring haha.

 

I too understand, so start by studying the proven designs used in Arduino boards, most if not all are open source so should be easy to find.

Ask questions here if you get stuck or need a clarification.

 

Good luck,

Have fun.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

soepblikje wrote:
second problem uart is only 8-bit:(

theusch wrote:
What do you mean by that?  Surely you are going to create a multi-byte message for your communications...

eg, see: https://www.avrfreaks.net/commen...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 8bit byte is the storage unit of most modern computing. The web page you’re reading now is simply a stream of bytes. It could be easily sent via the uart.

As the others have mentioned, you can take your 10bit value and make it printable using the likes of printf(). Or you could split your 10 bits into 2 or more bytes. Then there is the problem of figuring out which one is the first byte, second and so on. Thus you need a form of synchronisation.
To keep things simple, use printf() to make your value an ascii string and put a \n on the end. Your C# code can just read a line and return a string with the value you sent. I’m sure there is a C# function to convert a string of numbers back to a value.
If you want to send a number of different calues, you can use CSV format.
Eg 124,1,56,99\n

In the above example the string is 12 bytes long. Inefficient? Maybe. Convenient and easy to process? Yes.

A zillion people have had the same question:
https://forum.arduino.cc/index.php?topic=40336.0

Google arduino c# for more answers.

Last Edited: Tue. Mar 6, 2018 - 10:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:

 I just bought some CH340E *MODULES* that ae 16x16mm, and include connectors and LEDs.   

 

Interesting, that 'E' version looks to be MSOP10 and no Xtal, unlike the older 340G.

 

Have you checked what BAUD rates it supports, and what Baud Granularity ?