Click here to Skip to main content
15,900,589 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
JokeRe: old-iphones-become-faster-if-you-change-the-region-to-france Pin
den2k8825-Aug-21 23:05
professionalden2k8825-Aug-21 23:05 
GeneralRe: old-iphones-become-faster-if-you-change-the-region-to-france Pin
#realJSOP25-Aug-21 23:28
professional#realJSOP25-Aug-21 23:28 
GeneralRe: old-iphones-become-faster-if-you-change-the-region-to-france Pin
den2k8826-Aug-21 0:57
professionalden2k8826-Aug-21 0:57 
GeneralThought of the Day Pin
OriginalGriff25-Aug-21 4:34
mveOriginalGriff25-Aug-21 4:34 
GeneralRe: Thought of the Day Pin
Slow Eddie25-Aug-21 4:59
professionalSlow Eddie25-Aug-21 4:59 
GeneralRe: Thought of the Day Pin
jeron125-Aug-21 8:13
jeron125-Aug-21 8:13 
GeneralRe: Thought of the Day Pin
Gary R. Wheeler25-Aug-21 11:42
Gary R. Wheeler25-Aug-21 11:42 
GeneralVictory! Pin
CodeWraith25-Aug-21 2:21
CodeWraith25-Aug-21 2:21 
Serial communication without a UART, all in bit banged software, is fun. But it can also get a little frustrating at times. By now I have reached 19200 baud with variable timing constants and even 38400 baud if I throw out the timing loops and replace them by a few carefully calculated NOPs. If I can squeeze a few more bus cycles out of the processor, even 76800 baud may be possible. Really not so bad for a processor from 1976.

That works like a charm with normal terminal emulation, but a simple XMODEM upload can get hairy. On one side you have some PC that sends one byte after with its UART and without any notable delay. And on the other side you have a tiny 8 bit processor without a UART, flow control or any such luxuries.

The problem is that you have to do something with the bytes you have received and be ready in time to catch the next start bit, or else the whole timing will be thrown off and the upload will fail.

So where can we buy ourselves the time to calculate memory addresses or checksums when the bytes come in without delay? It's the stop bits. They are not relevant data, nor do they add any noteworthy security or error detection. One serial clock pulse is not much time, but it will have to do. 52 microseconds at 19200 baud. AT my current clock frequency, that gives me time for about 20 instructions before I have to be ready to receive the next byte. No more, no less.

So, I optimized the hell out of my code and ... it got worse. Especially at lower baud rates (where I should actually have more time) I got more errors than before. I was too fast and that led to the still incoming stop bit to be mistaken for the next start bit. A single additional instruction in the serial input routine to detect this and the problems went away. Victory!

Still, I could now go for 38400 baud. Maybe 10 instructions between incoming bytes are also enough...
I have lived with several Zen masters - all of them were cats.

His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

GeneralRe: Victory! Pin
Marc Clifton25-Aug-21 7:22
mvaMarc Clifton25-Aug-21 7:22 
GeneralRe: Victory! Pin
CodeWraith25-Aug-21 8:26
CodeWraith25-Aug-21 8:26 
JokeRe: Victory! Pin
raddevus25-Aug-21 10:14
mvaraddevus25-Aug-21 10:14 
GeneralRe: Victory! Pin
Gary R. Wheeler25-Aug-21 11:50
Gary R. Wheeler25-Aug-21 11:50 
GeneralRe: Victory! Pin
Mike Hankey25-Aug-21 11:23
mveMike Hankey25-Aug-21 11:23 
GeneralPredicting the Extinction of the Human Race Pin
#realJSOP25-Aug-21 0:42
professional#realJSOP25-Aug-21 0:42 
GeneralRe: Predicting the Extinction of the Human Race Pin
Marc Clifton25-Aug-21 1:17
mvaMarc Clifton25-Aug-21 1:17 
GeneralRe: Predicting the Extinction of the Human Race Pin
CodeWraith25-Aug-21 1:21
CodeWraith25-Aug-21 1:21 
GeneralRe: Predicting the Extinction of the Human Race Pin
MarkTJohnson25-Aug-21 1:21
professionalMarkTJohnson25-Aug-21 1:21 
GeneralRe: Predicting the Extinction of the Human Race Pin
obermd25-Aug-21 6:38
obermd25-Aug-21 6:38 
GeneralRe: Predicting the Extinction of the Human Race Pin
PIEBALDconsult25-Aug-21 9:24
mvePIEBALDconsult25-Aug-21 9:24 
GeneralRe: Predicting the Extinction of the Human Race Pin
GuyThiebaut26-Aug-21 0:37
professionalGuyThiebaut26-Aug-21 0:37 
GeneralAlmost became a father by accident... Pin
Sander Rossel25-Aug-21 0:03
professionalSander Rossel25-Aug-21 0:03 
GeneralRe: Almost became a father by accident... Pin
Daniel Pfeffer25-Aug-21 0:10
professionalDaniel Pfeffer25-Aug-21 0:10 
GeneralRe: Almost became a father by accident... Pin
DerekT-P25-Aug-21 1:01
professionalDerekT-P25-Aug-21 1:01 
RantRe: Almost became a father by accident... Pin
Dan Neely25-Aug-21 3:28
Dan Neely25-Aug-21 3:28 
GeneralRe: Almost became a father by accident... Pin
CodeWraith25-Aug-21 1:02
CodeWraith25-Aug-21 1:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   491 votes