Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

90can128 usart problems

90can128 usart problems

2009-09-12 by blue_eagle74

I tried to use the second usart on the 90can128, 8N1, but cant get it to work with the hyperterminal. Nothing even comes out of the chip. I have used the usart on the mega16 with no problem. following is a snippit of code using CV.

#include <90can128.h>
#include <stdio.h>
#include <delay.h>
           
main()
{
    UCSR1A = 0x00;
    UCSR1B = 0x98;
    UCSR1C = 0x06;
    UBRR1L = 0x51;
    UBRR1H = 0x00;

    while(1)
    {
        printf("testing");
        delay_ms(3000);
    }
}

Brian

Re: 90can128 usart problems

2009-09-12 by blue_eagle74

From what I know setting DDR is over ridden when seting the usart afterwards.

Symbolic names may help but I am just trying to get it working for now.

Brian
Show quoted textHide quoted text
> Did you set DDR for the output pin?  Always better to use the symbolic names
> rather
> than raw hex initializes as well.  Makes easier for others to follow your
> code.

Re: [AVR-Chat] 90can128 usart problems

2009-09-12 by Bob Paddock

On Sat, Sep 12, 2009 at 4:12 PM, blue_eagle74 <blue_eagle74@yahoo.com>wrote:

>
>
> I tried to use the second usart on the 90can128, 8N1, but cant get it to
> work with the hyperterminal. Nothing even comes out of the chip.
>




Did you set DDR for the output pin?  Always better to use the symbolic names
rather
than raw hex initializes as well.  Makes easier for others to follow your
code.


-- 
http://www.wearablesmartsensors.com/
http://www.softwaresafety.net/
http://www.designer-iii.com/
http://www.unusualresearch.com/


[Non-text portions of this message have been removed]

Re: 90can128 usart problems

2009-09-12 by blue_eagle74

An O-scope.

brian
Show quoted textHide quoted text
> When you say "nothing comes out", is that as observed with an  
> oscilloscope or on a terminal?
> 
> Jim Wagner
> Oregon Research Electonics
> 
> 
> 
> [Non-text portions of this message have been removed]
>

Re: 90can128 usart problems

2009-09-12 by blue_eagle74

I searched for the file 2usart_lcd.c and couldnt find it.

--- In AVR-Chat@yahoogroups.com, John Samperi <samperi@...> wrote:
Show quoted textHide quoted text
>
> At 06:12 AM 13/09/2009, you wrote:
> >I tried to use the second usart on the 90can128,
> >         printf("testing");
> 
> Doesn't printf default to USART0 with CVAVR?
> 
> Did you look at the example code 2usart_lcd.c
> in the example folder?
> 
> "Example program for redirecting the output of the
> standard C I/O functions to the following
> peripherals:
>      - USART 0
>      - USART 1
>      - LCD"
> 
> Regards
> 
> John Samperi
> 
> ********************************************************
> Ampertronics Pty. Ltd.
> 11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
> Tel. (02) 9674-6495       Fax (02) 9674-8745
> Website  http://www.ampertronics.com.au
> *Electronic Design * Custom Products * Contract Assembly
> ********************************************************
>

Re: [AVR-Chat] 90can128 usart problems

2009-09-12 by Jim Wagner

On Sep 12, 2009, at 1:12 PM, blue_eagle74 wrote:

> I tried to use the second usart on the 90can128, 8N1, but cant get  
> it to work with the hyperterminal. Nothing even comes out of the  
> chip. I have used the usart on the mega16 with no problem. following  
> is a snippit of code using CV.
>
> #include <90can128.h>
> #include <stdio.h>
> #include <delay.h>
>
> main()
> {
> UCSR1A = 0x00;
> UCSR1B = 0x98;
> UCSR1C = 0x06;
> UBRR1L = 0x51;
> UBRR1H = 0x00;
>
> while(1)
> {
> printf("testing");
> delay_ms(3000);
> }
> }
>
> Brian
>
>
> 
When you say "nothing comes out", is that as observed with an  
oscilloscope or on a terminal?

Jim Wagner
Oregon Research Electonics



[Non-text portions of this message have been removed]

Re: [AVR-Chat] 90can128 usart problems

2009-09-12 by John Samperi

At 06:12 AM 13/09/2009, you wrote:
>I tried to use the second usart on the 90can128,
>         printf("testing");

Doesn't printf default to USART0 with CVAVR?

Did you look at the example code 2usart_lcd.c
in the example folder?

"Example program for redirecting the output of the
standard C I/O functions to the following
peripherals:
     - USART 0
     - USART 1
     - LCD"

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] Re: 90can128 usart problems

2009-09-13 by Bob Paddock

You still have to set DDR as an output on that pin, *then* the USART will
override
the Port/PIN I/O functions with Tx/Out.  All pins default to inputs at reset
so that the
part does note have a "Lets Light Up the World" attitude like the old 6820
did.

On Sat, Sep 12, 2009 at 5:52 PM, blue_eagle74 <blue_eagle74@yahoo.com>wrote:

>
>
> From what I know setting DDR is over ridden when seting the usart
> afterwards.
>





> .
>


[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: 90can128 usart problems

2009-09-13 by John Samperi

At 09:39 AM 13/09/2009, you wrote:
>I searched for the file 2usart_lcd.c and couldnt find it.

In my evaluation copy of CVAVR is at C:\cvavreval\examples\2USART_LCD

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: 90can128 usart problems

2009-09-13 by blue_eagle74

I hope I didnt delete it during one of my cleanups. I dont see it. I may have to reinstall it.

Brian
Show quoted textHide quoted text
> In my evaluation copy of CVAVR is at C:\cvavreval\examples\2USART_LCD
> 
> Regards
> 
> John Samperi
>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.