Sign in

username:

password:



Not a member?

Search avrclub



Search tips

Subscribe to avrclub



avrclub by Keywords

AT90S2313 | AT90S8515 | ATMega | ATmega128 | ECL | FETS | IAR | Keyboard | LCD | STK50 | TMOS | UART


Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | AVRclub | [AVR club] usart to second avr.

Atmel AVR Microcontroller discussion group.

[AVR club] usart to second avr. - bazzapromenade - Jan 20 9:36:41 2009

I am trying to set up 2 avr's to talk to each other. similar to the
vellaman 10 channel 2 wire boards. I want an i/o change on one avr to
be mimicked on the other avr. I also want to use all the ports
available on an atmega 162. This will be a one way comunication. I
think I get how to send the change of i/o to the first usart but I am
unclear on what the second one does. Do I need to send a specific pin
instruction or can I just poll the complete pin regesters and send
them on. Does the receive avr just pick up the message as if it came
from within itself or does it need to be specifically adressed. I have
been having all sorts of trouble with trying to use "C" on studio4
with vista so I am using assembler. Any clarification would be greatly
appreciated.
Many thanks Bazza.
------------------------------------



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )


RE: [AVR club] usart to second avr. - Julian Higginson - Jan 21 10:21:31 2009

I don't understand what you're trying to do - past the basic transmission of
pin levels on one AVR to another.

Obviously you need pin(s) on the input AVR to send data
And you need pin(s) on the output AVR to receive data.
So these pins are not available as inputs on the input AVR or outputs on the
output AVR......

How fast does a change on input need to be reflected on an output?
You read and write pins as ports (though I don't use assembly so I can't
give you an example) so that's 8 bits at a time for a port that has all 8
pins available. Conveniently enough, that's one byte transmitted between the
AVRs, too...

Julian Higginson
Bruttour International P/L
http://www.bruttour.com.au
Ph: +612 9987 1581

-----Original Message-----
From: a...@yahoogroups.com [mailto:a...@yahoogroups.com] On Behalf Of
bazzapromenade
Sent: Tuesday, 20 January 2009 11:36 PM
To: a...@yahoogroups.com
Subject: [AVR club] usart to second avr.

I am trying to set up 2 avr's to talk to each other. similar to the
vellaman 10 channel 2 wire boards. I want an i/o change on one avr to
be mimicked on the other avr. I also want to use all the ports
available on an atmega 162. This will be a one way comunication. I
think I get how to send the change of i/o to the first usart but I am
unclear on what the second one does. Do I need to send a specific pin
instruction or can I just poll the complete pin regesters and send
them on. Does the receive avr just pick up the message as if it came
from within itself or does it need to be specifically adressed. I have
been having all sorts of trouble with trying to use "C" on studio4
with vista so I am using assembler. Any clarification would be greatly
appreciated.
Many thanks Bazza.
------------------------------------



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )

Re: [AVR club] usart to second avr. - bazzapromenade - Jan 22 10:42:30 2009

Yes, what I want to do is for the transmit avr(avr1) to read its i/o
pins, report any pins that are low to the usart and send there status
to the receive avr (avr2). Then the receive avr to reflect the status
of the low inputs on avr 1 as high outputs on avr2. My real question
is does the avr1 need to send anything other than the contents of
registers loaded with pin information, IE does the avr2 just take the
info from the recieve usart as if it was an instruction from within
itself or does it need a specific address , to know that the command
came from somewhere else and to execute it.
Bazza.
--- In a...@yahoogroups.com, "Julian Higginson" wrote:
>
> I don't understand what you're trying to do - past the basic
transmission of
> pin levels on one AVR to another.
>
> Obviously you need pin(s) on the input AVR to send data
> And you need pin(s) on the output AVR to receive data.
> So these pins are not available as inputs on the input AVR or
outputs on the
> output AVR......
>
> How fast does a change on input need to be reflected on an output?
> You read and write pins as ports (though I don't use assembly so I can't
> give you an example) so that's 8 bits at a time for a port that has
all 8
> pins available. Conveniently enough, that's one byte transmitted
between the
> AVRs, too...
>
> Julian Higginson
> Bruttour International P/L
> http://www.bruttour.com.au
> Ph: +612 9987 1581
>
> -----Original Message-----
> From: a...@yahoogroups.com [mailto:a...@yahoogroups.com] On
Behalf Of
> bazzapromenade
> Sent: Tuesday, 20 January 2009 11:36 PM
> To: a...@yahoogroups.com
> Subject: [AVR club] usart to second avr.
>
> I am trying to set up 2 avr's to talk to each other. similar to the
> vellaman 10 channel 2 wire boards. I want an i/o change on one avr to
> be mimicked on the other avr. I also want to use all the ports
> available on an atmega 162. This will be a one way comunication. I
> think I get how to send the change of i/o to the first usart but I am
> unclear on what the second one does. Do I need to send a specific pin
> instruction or can I just poll the complete pin regesters and send
> them on. Does the receive avr just pick up the message as if it came
> from within itself or does it need to be specifically adressed. I have
> been having all sorts of trouble with trying to use "C" on studio4
> with vista so I am using assembler. Any clarification would be greatly
> appreciated.
> Many thanks Bazza.
> ------------------------------------



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )

Re: [AVR club] usart to second avr. - Zack Widup - Jan 22 11:20:32 2009

If that is the only thing that is going to be sent between the two AVR's, I
would just send the contents of the register(s) read from the I/O pins
(ports) to the AVR2. They are not instructions but merely data. You could do
anything you want with the received data at that point - store it in a
register in AVR2, then load it into the outputs for the port(s) of AVR2,
etc.

Zack

On Wed, Jan 21, 2009 at 5:55 PM, bazzapromenade wrote:

> Yes, what I want to do is for the transmit avr(avr1) to read its i/o
> pins, report any pins that are low to the usart and send there status
> to the receive avr (avr2). Then the receive avr to reflect the status
> of the low inputs on avr 1 as high outputs on avr2. My real question
> is does the avr1 need to send anything other than the contents of
> registers loaded with pin information, IE does the avr2 just take the
> info from the recieve usart as if it was an instruction from within
> itself or does it need a specific address , to know that the command
> came from somewhere else and to execute it.
> Bazza.
>
> --- In a...@yahoogroups.com , "Julian
> Higginson" wrote:
> >
> > I don't understand what you're trying to do - past the basic
> transmission of
> > pin levels on one AVR to another.
> >
> > Obviously you need pin(s) on the input AVR to send data
> > And you need pin(s) on the output AVR to receive data.
> > So these pins are not available as inputs on the input AVR or
> outputs on the
> > output AVR......
> >
> > How fast does a change on input need to be reflected on an output?
> >
> >
> > You read and write pins as ports (though I don't use assembly so I can't
> > give you an example) so that's 8 bits at a time for a port that has
> all 8
> > pins available. Conveniently enough, that's one byte transmitted
> between the
> > AVRs, too...
> >
> >
> >
> >
> >
> > Julian Higginson
> > Bruttour International P/L
> > http://www.bruttour.com.au
> > Ph: +612 9987 1581
> >
> > -----Original Message-----
> > From: a...@yahoogroups.com [mailto:
> a...@yahoogroups.com ] On
> Behalf Of
> > bazzapromenade
> > Sent: Tuesday, 20 January 2009 11:36 PM
> > To: a...@yahoogroups.com
> > Subject: [AVR club] usart to second avr.
> >
> > I am trying to set up 2 avr's to talk to each other. similar to the
> > vellaman 10 channel 2 wire boards. I want an i/o change on one avr to
> > be mimicked on the other avr. I also want to use all the ports
> > available on an atmega 162. This will be a one way comunication. I
> > think I get how to send the change of i/o to the first usart but I am
> > unclear on what the second one does. Do I need to send a specific pin
> > instruction or can I just poll the complete pin regesters and send
> > them on. Does the receive avr just pick up the message as if it came
> > from within itself or does it need to be specifically adressed. I have
> > been having all sorts of trouble with trying to use "C" on studio4
> > with vista so I am using assembler. Any clarification would be greatly
> > appreciated.
> > Many thanks Bazza.
> >
> >
> > ------------------------------------
> >
> >

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )

Re: [AVR club] usart to second avr. - bazzapromenade - Jan 26 17:07:35 2009

--- In a...@yahoogroups.com, Zack Widup wrote:
> Thanks Zack, My confusion is that I want avr1 to report its pin
condition for ports A,B,C and D to avr2. Then for avr2 to switch its
corresponding i/o's. I read pinA and tx to avr2. rx the data and load
into a register, How does avr2 know which port those 8 bits belong to?
A,B,C or D.I must need to be able to send some form of address on the
next or previouse tx to tell avr2, where the byte of data is to go. Or
am I totally messed up here? I know this is basic stuff for you guys
but for me not having any micro knowledge beforehand its a steep
learning curve. Most of it makes sense but try as I might I cant find
how to adrress it.
Thanks again Bazza.

> If that is the only thing that is going to be sent between the two
AVR's, I
> would just send the contents of the register(s) read from the I/O pins
> (ports) to the AVR2. They are not instructions but merely data. You
could do
> anything you want with the received data at that point - store it in a
> register in AVR2, then load it into the outputs for the port(s) of AVR2,
> etc.
>
> Zack
>
> On Wed, Jan 21, 2009 at 5:55 PM, bazzapromenade wrote:
>
> > Yes, what I want to do is for the transmit avr(avr1) to read its i/o
> > pins, report any pins that are low to the usart and send there status
> > to the receive avr (avr2). Then the receive avr to reflect the status
> > of the low inputs on avr 1 as high outputs on avr2. My real question
> > is does the avr1 need to send anything other than the contents of
> > registers loaded with pin information, IE does the avr2 just take the
> > info from the recieve usart as if it was an instruction from within
> > itself or does it need a specific address , to know that the command
> > came from somewhere else and to execute it.
> > Bazza.
> >
> > --- In a...@yahoogroups.com , "Julian
> > Higginson" wrote:
> > >
> > > I don't understand what you're trying to do - past the basic
> > transmission of
> > > pin levels on one AVR to another.
> > >
> > > Obviously you need pin(s) on the input AVR to send data
> > > And you need pin(s) on the output AVR to receive data.
> > > So these pins are not available as inputs on the input AVR or
> > outputs on the
> > > output AVR......
> > >
> > > How fast does a change on input need to be reflected on an output?
> > >
> > >
> > > You read and write pins as ports (though I don't use assembly so
I can't
> > > give you an example) so that's 8 bits at a time for a port that has
> > all 8
> > > pins available. Conveniently enough, that's one byte transmitted
> > between the
> > > AVRs, too...
> > >
> > >
> > >
> > >
> > >
> > > Julian Higginson
> > > Bruttour International P/L
> > > http://www.bruttour.com.au
> > > Ph: +612 9987 1581
> > >
> > > -----Original Message-----
> > > From: a...@yahoogroups.com [mailto:
> > a...@yahoogroups.com ] On
> > Behalf Of
> > > bazzapromenade
> > > Sent: Tuesday, 20 January 2009 11:36 PM
> > > To: a...@yahoogroups.com
> > > Subject: [AVR club] usart to second avr.
> > >
> > > I am trying to set up 2 avr's to talk to each other. similar to the
> > > vellaman 10 channel 2 wire boards. I want an i/o change on one
avr to
> > > be mimicked on the other avr. I also want to use all the ports
> > > available on an atmega 162. This will be a one way comunication. I
> > > think I get how to send the change of i/o to the first usart but
I am
> > > unclear on what the second one does. Do I need to send a
specific pin
> > > instruction or can I just poll the complete pin regesters and send
> > > them on. Does the receive avr just pick up the message as if it came
> > > from within itself or does it need to be specifically adressed.
I have
> > > been having all sorts of trouble with trying to use "C" on studio4
> > > with vista so I am using assembler. Any clarification would be
greatly
> > > appreciated.
> > > Many thanks Bazza.
> > >
> > >
> > > ------------------------------------
> > >
> > >



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )

Re: [AVR club] usart to second avr. - Zack Widup - Jan 26 17:32:38 2009


You're probably going to have to send at least two bytes to the AVR2.
I'd make the first one contain the info on which port is being sent,
and the second one contain the port data. Maybe just set bits 0, 1, 2
or 3 of the first byte sent by AVR1 to "1". Then, program the AVR2 so
it knows which one was read corresponding to that bit.

Zack

--- In a...@yahoogroups.com, "bazzapromenade" wrote:
>
> --- In a...@yahoogroups.com, Zack Widup wrote:
> > Thanks Zack, My confusion is that I want avr1 to report its pin
> condition for ports A,B,C and D to avr2. Then for avr2 to switch its
> corresponding i/o's. I read pinA and tx to avr2. rx the data and load
> into a register, How does avr2 know which port those 8 bits belong to?
> A,B,C or D.I must need to be able to send some form of address on the
> next or previouse tx to tell avr2, where the byte of data is to go. Or
> am I totally messed up here? I know this is basic stuff for you guys
> but for me not having any micro knowledge beforehand its a steep
> learning curve. Most of it makes sense but try as I might I cant find
> how to adrress it.
> Thanks again Bazza.
>
>
> > If that is the only thing that is going to be sent between the two
> AVR's, I
> > would just send the contents of the register(s) read from the I/O pins
> > (ports) to the AVR2. They are not instructions but merely data. You
> could do
> > anything you want with the received data at that point - store it in a
> > register in AVR2, then load it into the outputs for the port(s) of
AVR2,
> > etc.
> >
> > Zack
> >
> > On Wed, Jan 21, 2009 at 5:55 PM, bazzapromenade wrote:
> >
> > > Yes, what I want to do is for the transmit avr(avr1) to read
its i/o
> > > pins, report any pins that are low to the usart and send there
status
> > > to the receive avr (avr2). Then the receive avr to reflect the
status
> > > of the low inputs on avr 1 as high outputs on avr2. My real question
> > > is does the avr1 need to send anything other than the contents of
> > > registers loaded with pin information, IE does the avr2 just
take the
> > > info from the recieve usart as if it was an instruction from within
> > > itself or does it need a specific address , to know that the command
> > > came from somewhere else and to execute it.
> > > Bazza.
> > >
> > > --- In a...@yahoogroups.com , "Julian
> > > Higginson" wrote:
> > > >
> > > > I don't understand what you're trying to do - past the basic
> > > transmission of
> > > > pin levels on one AVR to another.
> > > >
> > > > Obviously you need pin(s) on the input AVR to send data
> > > > And you need pin(s) on the output AVR to receive data.
> > > > So these pins are not available as inputs on the input AVR or
> > > outputs on the
> > > > output AVR......
> > > >
> > > > How fast does a change on input need to be reflected on an output?
> > > >
> > > >
> > > > You read and write pins as ports (though I don't use assembly so
> I can't
> > > > give you an example) so that's 8 bits at a time for a port
that has
> > > all 8
> > > > pins available. Conveniently enough, that's one byte transmitted
> > > between the
> > > > AVRs, too...
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Julian Higginson
> > > > Bruttour International P/L
> > > > http://www.bruttour.com.au
> > > > Ph: +612 9987 1581
> > > >
> > > > -----Original Message-----
> > > > From: a...@yahoogroups.com [mailto:
> > > a...@yahoogroups.com ] On
> > > Behalf Of
> > > > bazzapromenade
> > > > Sent: Tuesday, 20 January 2009 11:36 PM
> > > > To: a...@yahoogroups.com
> > > > Subject: [AVR club] usart to second avr.
> > > >
> > > > I am trying to set up 2 avr's to talk to each other. similar
to the
> > > > vellaman 10 channel 2 wire boards. I want an i/o change on one
> avr to
> > > > be mimicked on the other avr. I also want to use all the ports
> > > > available on an atmega 162. This will be a one way comunication. I
> > > > think I get how to send the change of i/o to the first usart but
> I am
> > > > unclear on what the second one does. Do I need to send a
> specific pin
> > > > instruction or can I just poll the complete pin regesters and send
> > > > them on. Does the receive avr just pick up the message as if
it came
> > > > from within itself or does it need to be specifically adressed.
> I have
> > > > been having all sorts of trouble with trying to use "C" on studio4
> > > > with vista so I am using assembler. Any clarification would be
> greatly
> > > > appreciated.
> > > > Many thanks Bazza.
> > > >
> > > >
> > > > ------------------------------------
> > > >
> > > >



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )