473,805 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RS232 & AVR-Board button

Hi

I'm programming C to an AVR-Board and would like to activate a register on
the board with an C# application. Instead of pressing the button (PINA.4 or
address 0x19 bit 4) , i would like to press a button i C# instead. I got a
serial connection to the board and experimented a bit, but i'm quite lost. I
know howto send text...
SerialPort port = new SerialPort("COM 1", 9600, Parity.None, 8,
StopBits.One);

// Open the port for communications
port.Open();

// Write a string
port.Write(Conv ert.ToString(Co nvert.ToChar(0x 19)));

// Close the port
port.Close();

Thank you in advance

/Lars

Nov 27 '06 #1
3 5017
"Lars" <La**@discussio ns.microsoft.co mwrote in message
news:EE******** *************** ***********@mic rosoft.com...
Hi

I'm programming C to an AVR-Board and would like to activate a register on
the board with an C# application. Instead of pressing the button (PINA.4
or
address 0x19 bit 4) , i would like to press a button i C# instead. I got
a
serial connection to the board and experimented a bit, but i'm quite lost.
I
know howto send text...
I'm lost to, what are you asking?

Michael
Nov 27 '06 #2
I'm lost to, what are you asking?
Let me try again...

I want to use C# to send a '1' to a AVR-board, that '1' shall set bit 4 on
the hex address 0x19. That '1' should be send through RS232. I got the
connection working, i just don't know how or if it's possible to do that. I
know very little about C#.

/Lars

Nov 27 '06 #3
Lars wrote:
>>I'm lost to, what are you asking?

Let me try again...

I want to use C# to send a '1' to a AVR-board, that '1' shall set bit 4 on
the hex address 0x19. That '1' should be send through RS232. I got the
connection working, i just don't know how or if it's possible to do that. I
know very little about C#.

/Lars
Please post your code somewhere.

If you have a connection working, then this should work.

Can you use a terminal program and send the '1' to the AVR board ??

Does that work ?

Can you use a terminal on another computer and see the '1' comming from
your C# program ?
Testing is as important as writing a program. Get the tools that
simulate what you are trying to do.

donald
Nov 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7832
by: Dan | last post by:
I wnat to see in browser an status from an device connected on rs232 port The java class for read from serial port is: //Serial.java import java.io.*; import java.util.*; import java.lang.*; import javax.comm.*;
6
7645
by: Przemo | last post by:
Hi, Do you know some good RS232C class? There is one in VB.NET 101 Examples, but I think it is poor. 1. I can't for e.g. read into my application all data received. I must tell how many bytes I would like to read. If I specify too many exception occures, if too less there are still some data in buffer.
6
3156
by: Affan Syed | last post by:
I am not able to figure out exactly what this macro is doing. Can one of the gurus around here decipher this? #define sei() __asm__ __volatile__ ("sei" ::) PS: It is from the avr-libc interrupt.h and it should set a partilcular interrrupt. Thanks.
8
2065
by: Terry Olsen | last post by:
I'm trying to use the RS232 class that was in the Platform SDK (i think). Has anyone else used this with events successfully? Here's what i've got: ====================== Public WithEvents bbsPort As Rs232 = New Rs232 With bbsPort .BaudRate = baud .DataBit = dataBits .Parity = parity .Port = comPort
2
4770
by: RadGar | last post by:
Hi, I'm reposting my question in this group from comp.arch.embedded - as it was suggested to me that it might be better to do so. In advance to all reading: this is meant mostly for people who code in C++ for microcontrollers such as AVR. So here it goes: I am making a school project for PocketPC which is to send some data
4
5507
by: Dave Harry | last post by:
I found the RS232 class from MS's 101 VB samples. Writing to the port works fine. (I've got hyperterminal on the other comm port and a crossover cable between COM1 and COM2) The port is opened with: Public switchcom As New Rs232 switchcom.Open(2, 57600, 8, Rs232.DataParity.Parity_None, Rs232.DataStopBit.StopBit_1, 512)
6
4063
by: Henning M | last post by:
Hi all, Im trying to send a command to my uprocessor project, but when i try to read the answer for the uPU I get the same commed I just send to it??? It is as if the command isn't send before I close the connection? Can it have something to do with Async/sync read/write???? Everything works when I just type the commands i Hyper Terminal I get the respond as I should...
3
5232
by: ad | last post by:
I am using VS2005 to develop Web application. How can I receive the data from RS232 of client's computer?
3
1791
by: lorenzvvv | last post by:
Hello! I need to compile a program where wctomb and mbtowc functions are in. These functions are useful for conversions from wide characters to multi-byte and vice versa. Avr-gcc lacks wctype.h (that contains them). Does exist a library to include in my sources or should I write those two functions on my own? Thanks, in advance.
3
4084
by: phoenix1990 | last post by:
so i started learning avr-c programming a few weeks ago and i'm a little confused about using the eeprom so save values. i've been working a snake game for my project, and i need to save everything at any point to the eeprom so that the user can load it from that spot again. but first i've been receiving warnings in regard to the way i've been trying to save the the highscore #include <avr/eeprom.h> eeprom_write_word(1, hiscore);...
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.