Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MicroController - Visual Interface (Visual Studio 2010)

Status
Not open for further replies.

wa7ed

Newbie level 5
Newbie level 5
Joined
Feb 19, 2010
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,355
I want to use Visual Studio 2010 to make an interface to control a microcontroller.

What are the function/codes to communicate(Tx & Rx) with RS232 ?
Are there Any tutorials for this point ?^^
 

I've seen people using Visual Studio C++ Express Edition and GCC as the compiler.

Can I configure Visual Studio to build AVR C programs ?

https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=367179

Your microcontroller needs to be programmed (firmware) to be able to respond to commands from your application through RS-232.

Look at the Bus Pirate project, it works with RS-232 terminal software, so you can program your own application and send commands through the serial port, but it is the firmware in the PIC microcontroller which allows the communication to take place in the first place.
 

    wa7ed

    Points: 2
    Helpful Answer Positive Rating
You want to use Visual Studio 2010 but what language do you want to use ?

Do you want to use .NET ?
 

    wa7ed

    Points: 2
    Helpful Answer Positive Rating
Thanks guys for your replies ...
My Microcontroller at the moment is working well with the HyperTerminal. Now, I want to use the graphical interface instead..

-

-(liyin)
I confused with the AVR !! is it a type of programming languages ?
Visual Studio 2010 considered as a compiler.. Isn't it ?
Do I have to use/add some supporting software or Visual Studio can work alone ?

-(daviddlc)

Yes I want .NET
if there is a language easier and do the job that would be better

THANKS FOR YOUR HELP AGAIN..
=)
 

Don't you have answers from your other post? . Does it make any sense by creating same again?
 

Oh ! so sorry , I forgot that I've posted there ..
 

wa7ed said:
Oh ! so sorry , I forgot that I've posted there ..

I am not giving warning in this time but you lose 5 points as a penalty

Read rules, announcements before posting
 

If you are interested in programming with the .NET framework for small devices check this:

.NET Micro Framework

**broken link removed**

Atmel microcontrollers are called "AVR's", just like Microchip microcontrollers are called "PIC's".

You can use Visual Studio IDE to program in C/C++, but compile using the AVR-GCC compiler. I believe some people have come up with Visual Studio add-ins to do this, but you can easily configure the Visual Studio IDE to do it (check the link I posted before).

If you want to use Visual Studio's own compilers, then check the .NET Micro Framework above, but you are limited to 32-bit chips, and the framework must support the chip you are interested in, unless the company making the chip makes a port of the .NET Micro Framework that targets that chip.
 

    wa7ed

    Points: 2
    Helpful Answer Positive Rating
hello friend,

i can tell you much about how this can be done - i have done it on the job. 6 years ago i cross trained into MS .NET then the past 4 years i have been designing / building MS .NET based windows control apps for USB / RS232 / parallel port / LAN connectivity to various devices. My deliverables were custom applications that allow user to perform product / device validation test.

Some devices have virtual com port like cell phones, and others. but for microcontrollers there are many OEM usb variants to connect to microcontrollers - i have been using on the job and on my own FTDI based connectivity.

now, to answer your question; its easiest to tell you what i have done to give you an idea of what is involved;

Hardware:
I have a DLP2232PB evaluation board that plugs into USB from www.dlpdesigns.com. it has a microchip PIC16F877 controller on board and a FT2232 dual port USB chip on board.
Software:
-on microcontroller - since we are connected to usb port, we need to read/write at byte level using a simple packet passing protocol - some functions used;
recieve_packet();
send(); //send byte through USB interface
int8 read_usb();read usb, toggling RD line of controller

-on desktop - depends how i decide to interact with usb - as USB i can use the D2XX drivers to interact with the USB chip first. since it has 2 ports they can independently be configured on the fly as usb or Virtual com port. you can do this in control file, but ultimately do it in configuration file.

Now, on to serial port; specifically, with VS 2010, you need to add a project to the solution that will build a DLL. I wrote it in c#, so in the new class library, you need to add reference to System.IO.Ports; to access serial ports and add reference to System.Diagnostics; to be able to make windows 'process' calls. here, you can re-direct any command line driven process which is normally done on command line, into your windows application. so this is redirecting STDIN/STDOUT/STDERR streams into your app away from console.

due to the shear size of the some of the options for microcontroller compiler tools, i am building sql server database to make it easier to manage. if it is in simple relational database of command/description format, it is not too hard to set this up.

now back to microcontroller code needed; so i named some functions needed, but in order that both your controller AND your desktop app BOTH understand each other they both need common byte codes representing specific functions that are executed on the controller(industry calls these constructs MUTEXES or SEMAPHORES); for example, one that i have when you press the GO button in the c# windows application, the desktop AND the controller knows that this is hex command 0xA8. so the controller knows that 0xA8 means to bounce back to desktop and send the string 'HELLO'. DLPdesigns put this stuff onto the controller as part of its original demo to the developer. I later used this on the job at t-mobile to do some automation work using the a/d converter on the pic to sample incoming data, buffer it and parse it out on the other end.

I'm doing part of this stuff in my demos that i show at interview time, as i have been on unemployment for just over a year now. i originally learned microcontroller as part of my BSEET degree in 1994 and did interrupt driven coding for those devices, then when i got the MS .NET training 6 years ago, i learned how to do that stuff. now my high end desktop and low end devices are interacting - very cool stuff and can be very powerful.

so, questions are welcome.

have a good day.

Ron
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top