Building a better bit-bang UART

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

I've written a blog post describing asynchronous serial UART communication and my bit-bang UART library, picoUART.

http://nerdralph.blogspot.com/20...

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

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

About a Year or two ago I found the article you did a while back on using Arduino/GCC with asm based on AVR305, really opened some doors for me. I prefer ASM but it's good to know how to interface the two.

Good stuff... thanks Ralph!

 

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

Plexd wrote:

About a Year or two ago I found the article you did a while back on using Arduino/GCC with asm based on AVR305, really opened some doors for me. I prefer ASM but it's good to know how to interface the two.

Good stuff... thanks Ralph!

 

It was only the first soft UART I released that was partly based on AVR305.  Then within a few months I re-wrote the transmit routine to use the T bit, in order to eliminate the timing jitter between zero and one bits.  I think it was around the same time I integrated the delay loop within the tx code, which increased the upper limit on the baud rate by eliminating the rcall/ret overhead.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
// use static inline functions for type safety
extern inline float PUBIT_CYCLES() {return F_CPU/(PU_BAUD_RATE*1.0);}

 

Why "extern inline" ?   That's a new combination for me.  (Seems appropriate from what I can google, but I'm not sure I understand why...)

 

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

westfw wrote:

// use static inline functions for type safety
extern inline float PUBIT_CYCLES() {return F_CPU/(PU_BAUD_RATE*1.0);}

 

Why "extern inline" ?   That's a new combination for me.  (Seems appropriate from what I can google, but I'm not sure I understand why...)

 

 

I read about the "extern inline" recommendation as a substitute for macros in the gcc docs.

https://gcc.gnu.org/onlinedocs/g...

 

 

I have no special talents.  I am only passionately curious. - Albert Einstein