EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Software serial port code for Tiny26?

Started by David L. Jones May 26, 2004
Ok, I thought this one would be easy...
I'm after some C code for a software serial port for the Tiny26, or
any AVR for that matter. I thought such code would exist, but I
can't seem to find it...
I can't use the USI either, I want a pure software solution at low
speed (300bps would be plenty)
I could write one myself, but I'd rather not spend the time, and I
know there must be code out there already!
Any links appreciated.

Thanks
Dave :)


--- In avrclub@avrc..., "David L. Jones" <david.jones@s...>
wrote:
> Ok, I thought this one would be easy...
> I'm after some C code for a software serial port for the Tiny26,
or
> any AVR for that matter. I thought such code would exist, but I
> can't seem to find it...
> I can't use the USI either, I want a pure software solution at low
> speed (300bps would be plenty)
> I could write one myself, but I'd rather not spend the time, and I
> know there must be code out there already!
> Any links appreciated.
>
> Thanks
> Dave :)

Scratch that!
Looks like I found one that does the job.

Thanks
Dave :)


--- In avrclub@avrc..., "David L. Jones" <david.jones@s...>
wrote:
> --- In avrclub@avrc..., "David L. Jones"
<david.jones@s...>
> wrote:
> > Ok, I thought this one would be easy...
> > I'm after some C code for a software serial port for the Tiny26,
> or
> > any AVR for that matter. I thought such code would exist, but I
> > can't seem to find it...
> > I can't use the USI either, I want a pure software solution at
low
> > speed (300bps would be plenty)
> > I could write one myself, but I'd rather not spend the time, and
I
> > know there must be code out there already!
> > Any links appreciated.
> >
> > Thanks
> > Dave :)
>
> Scratch that!
> Looks like I found one that does the job.

Bugger!
Spoke too soon.
The one I found used interrupts and timers.
I would prefer a software UART routine that does not use any
hardware resources, i.e. it is simply polled.
Anyone seen anything like that?

Thanks
Dave :)


>From: "David L. Jones" <david.jones@davi...>
>Ok, I thought this one would be easy...
>I'm after some C code for a software serial port for the Tiny26, or
>any AVR for that matter. I thought such code would exist, but I
>can't seem to find it...


Dave,

The book "Crash Course in PC and Microcontroller Technology" by Frenzel has
a couple of chapters that would cover what you need.

Damn book, a programmed text, is full of errors, but they're easy to spot.

Cheers,

-dlj.

_________________________________________________________________
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID94&DI34&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines


Hello,

This appnote on Atmel's site explains how to do a polled software UART and
has sample code in ASM. I have used this before and it was real easy to
incorporate the ASM into my C app using IAR.

Also have you looked on AVRfreaks?

Thanks,
Dave Miller
CipherLab
(888)825-7713

> -----Original Message-----
> From: David L. Jones [mailto:david.jones@davi...]
> Sent: Wednesday, May 26, 2004 7:40 AM
> To: avrclub@avrc...
> Subject: [AVR club] Re: Software serial port code for Tiny26?
>
> --- In avrclub@avrc..., "David L. Jones" <david.jones@s...>
> wrote:
> > --- In avrclub@avrc..., "David L. Jones"
> <david.jones@s...>
> > wrote:
> > > Ok, I thought this one would be easy...
> > > I'm after some C code for a software serial port for the Tiny26,
> > or
> > > any AVR for that matter. I thought such code would exist, but I
> > > can't seem to find it...
> > > I can't use the USI either, I want a pure software solution at
> low
> > > speed (300bps would be plenty)
> > > I could write one myself, but I'd rather not spend the time, and
> I
> > > know there must be code out there already!
> > > Any links appreciated.
> > >
> > > Thanks
> > > Dave :)
> >
> > Scratch that!
> > Looks like I found one that does the job.
>
> Bugger!
> Spoke too soon.
> The one I found used interrupts and timers.
> I would prefer a software UART routine that does not use any
> hardware resources, i.e. it is simply polled.
> Anyone seen anything like that?
>
> Thanks
> Dave :) > Yahoo! Groups Links >
>





>>> dave@dave... 27/05/2004 1:50:38 am >>>
Hello,

This appnote on Atmel's site explains how to do a polled software UART
and
has sample code in ASM. I have used this before and it was real easy
to
incorporate the ASM into my C app using IAR.

Also have you looked on AVRfreaks?

Thanks,
Dave Miller
CipherLab
(888)825-7713

Hi Dave,
Which app note is that?, the only one I could find was using the USI
module.
Yes, I searched AVRfreaks and couldn't find anything.

Regards
Dave :)



Here is the link again
http://www.atmel.com/dyn/resources/prod_documents/DOC0952.PDF

It is Appnote #305

Thanks,
Dave Miller
CipherLab > -----Original Message-----
> From: David Jones [mailto:david.jones@davi...]
> Sent: Wednesday, May 26, 2004 4:22 PM
> To: avrclub@avrc...
> Subject: RE: [AVR club] Re: Software serial port code for Tiny26? >
> >>> dave@dave... 27/05/2004 1:50:38 am >>>
> Hello,
>
> This appnote on Atmel's site explains how to do a polled software UART
> and
> has sample code in ASM. I have used this before and it was real easy
> to
> incorporate the ASM into my C app using IAR.
>
> Also have you looked on AVRfreaks?
>
> Thanks,
> Dave Miller
> CipherLab
> (888)825-7713
>
> Hi Dave,
> Which app note is that?, the only one I could find was using the USI
> module.
> Yes, I searched AVRfreaks and couldn't find anything.
>
> Regards
> Dave :) >
>
> Yahoo! Groups Links >
>




The 2024 Embedded Online Conference