AVR-DA USART does not have 2 stop bits

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I set 2 stop bits in USART of AVR-DA, but when I look at the scope, there are only 1.5 bits.
I operated TINY1 with the same settings, but normally 2 bits are output.

Is this errata?
Not a problem for me, but I think 1.5 bit is obsolete and nobody wants it.

 

AVR128DA28

 

TINY1616

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What's the data rate?

What's the sampling rate of your scope?

What code is generating the above?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

Last Edited: Tue. Aug 18, 2020 - 08:29 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks like someone forgot to test the chip design.

 

And it's not with Irda or 2X I guess.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:

It looks like someone forgot to test the chip design.

 

Or the OP hasn't initialised the USART correctly.

Or the OP isn't sending data to the USART correctly.

Or....

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now it's hard to send 1.5 stopbit on a chip that don't support it!

 

But yes let's see the code, or someone with studio7 should simulate it. (the simulation model should be generated by the chip design)  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm sorry. Probably a code issue.

 

Now that I've left the office, I don't have the problematic code.
So I tried to write "minimum code to reproduce the problem" but could not reproduce it.

The following code correctly sends out 2 stop bits, whether it's a 128DA28 or a mega4809.

 

#define F_CPU   4000000UL   /* for AVR-DA */
//#define F_CPU 3333333UL   /* for mega0 */

#include <avr/io.h>
#define BPS 4800

int main(void){
    PORTA.OUTSET = PORTA.DIRSET = PIN0_bm;
    
    USART0.BAUD = (uint16_t)(64.0f * F_CPU / 16 / BPS);
    USART0.CTRLC = USART_SBMODE_bm | USART_CHSIZE_8BIT_gc;
    USART0.CTRLB = USART_TXEN_bm;

    while (1){
        if (USART0.STATUS & USART_DREIF_bm){
            USART0.TXDATAL = 0x55;
        }
    }
}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kabasan wrote:
I think 1.5 bit is obsolete and nobody wants it.

The original purpose for the extended bit time was to give the mechanical printer time to handle the data received, i.e. print the character or position the print head, etc...

Most async serial apps today don't need this extra time except perhaps to handle the interrupt buffering overhead at very high speeds, so obsolete, not really, but perhaps seldom needed.

Jim

 

 

Keys to wealth:

Invest for cash flow, not capital gains!

Wealth is attracted, not chased! 

Income is proportional to how many you serve!

Lets go Brandon!