Go Down

Topic: Yet another Software Serial (Read 54553 times) previous topic - next topic

abeltomillo

Robin!! Finally! It does work! Don't ask me how, but it does, without any modification. I knew I was doing something bad, for sure it was the reading, because I didn't know the protocol well.

I am using Freaduino Pro Mini 5V, which has an ATMEGA328P and it is Arduino Pro Mini 5V LIKE.


Fine!!! Thanks a lot, now I am going to try the servo with it's library ;)

yupiiiyeiiii!!


cheers,

thanks.

nickgammon

How many threads did you start? (don't answer that).

I merged those two.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

abeltomillo


Robin2


How many threads did you start? (don't answer that).

I merged those two.


It seems that you merged (some or all of) @abeltomillo's Threads into one of mine and managed to change my Title to his Title.
Imagine my surprise to discover I was the owner of a Thread I didn't know I started.

The merge probably doesn't matter because he might have started his questions in my Thread anyway.

I have changed the Thread title back to the original.

@abeltomillo - NO thanks for all the confusion.
                              YES thanks for confirming my code works.

The extra "half" bit width is to ensure the samples are taken in the middle of a bit rather than at the edge. It also provides some slack to cope with slight timing errors. The interrupt that detects the start-bit resets the timing measurements for every byte so there are no long-run cumulative errors.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Robin2


@Robin2 - sorry.


I think, where you come from, my response would be  "no worries".

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

abeltomillo


abeltomillo

#23
Sep 11, 2014, 12:51 am Last Edit: Sep 11, 2014, 12:55 am by abeltomillo Reason: 1
but I can't just be quiet, I must say:

I won't comment about your code, just to say it's horrible that people thinks that helping others mean radical criticism and comments that doesn't help neither to make you feel good because someone answered you.

really, don't understand how people can be so rude, just because they don't get paid.

And yes, your code is crappy coded, that's the way I didn't understood the first line. How can a software be called: sss?

Seriously, improve your person before to tell others how they should be, you make me went crazy because your comments were out of topic, please be less, and more. If you don't understand, then you have a problem.

be safe, be good.

abel.

Robin2


but I can't just be quiet, I must say:

I won't comment about your code, just to say it's horrible that people thinks that helping others mean radical criticism and comments that doesn't help neither to make you feel good because someone answered you.

really, don't understand how people can be so rude, just because they don't get paid.

And yes, your code is crappy coded, that's the way I didn't understood the first line. How can a software be called: sss?

Seriously, improve your person before to tell others how they should be, you make me went crazy because your comments were out of topic, please be less, and more. If you don't understand, then you have a problem.

be safe, be good.

abel.


I really don't understand what this is all about or who it is aimed at.

I assume the bit I have highlighted in bold is aimed at me.

I'm real broken up that you didn't understand the first line which is
Code: [Select]
const int sssBaudRate = 9600;

I called it sss because at the time I was naming it Simple Software Serial and I was too lazy to type all of that - but feel free to rename your copy to anything that pleases you. The name is not a critical part of the functionality.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

abeltomillo

Robin2, the following words are not aimed to you, i'm speaking in general, and a bit referencing you because you were rude, and I get very disgusted. So, just to say I'm pissed of people that thinks helping mean criticism agains the people who doesn't know so much as the helpers do. And they use the forums, which are open, to hit psichologically pepople who are very sensible, and they don't blame against them just to keep the peace. I was very sad to read your answers against my confussion. YES! I was confussed, as it was very hard to understand the whole code, but I am strong, and I got it! but, please, don't feel angry or disgusted because of my words now, and before. Just I understand you, but I was very angry with that kind of people. Just sorry, and thanks for helping me in that company.

Now, I just want to tell you that I've been developing a new simple software serial, but this time for pure C, but it doesn't use the TIMER2 only. It allows tx and rx at same time. But as I don't use the Arduino's core, I can use TIMER0 for rx, and TIMER2 for tx. The  I will use TIMER1 for pulse and refresh the servo. I hope that version works with no buzzing.

as your style is so concrete, I finally liked it, so:

NO thanks for being rude.
YES thanks for being so helpful, and share your great idea of serial com. implementation by software for Arduino.

And I finish this post, just saying: I copied your idea, and I copied the way you handle the buffer with the routines: sssRead(), sssWrite(), and sssAvailable(). It's crazy amazing how you did, and how I can't still understand... well (sssRead() concretelly).

Cheers,

Abel.

abeltomillo

About sss, I recommend you to use TIMER2 in CTC mode and avoiding clearing Compate Match A flag the whole time, and also Overflow... It's not necessary really.

cheers,

abel.

Robin2

#27
Sep 12, 2014, 09:55 am Last Edit: Sep 12, 2014, 10:02 am by Robin2 Reason: 1

About sss, I recommend you to use TIMER2 in CTC mode and avoiding clearing Compate Match A flag the whole time, and also Overflow... It's not necessary really.


You may well be correct. I just work things out from the Atmel datasheet and I probably just use the first thing that works. But I am not going to spend an hour or so that would be necessary to re-learn my own code before I could come to a conclusion.

I have now reviewed all of my Replies in this Thread and I don't believe I was in the least bit rude to you in any of them and I object strongly to your suggestion that I was. If I have overlooked something please be good enough to quote the item that upset you and don't speak in generalities.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

abeltomillo

Don't worry, I understand.

If your were working well with Servo library (official) I would do the changes, but I started the software project from scratch and without Arduino core for taking advantage of the speed, interrupts free, and more light code. But also I learnt a lot.

Maybe I finish this project, and make a library for software serial based on your code, but with some pluses or improvements. The thing is I try to make to work a servo and a GSM module, without hardware serial, and without buzzing on my servo. And... damn dude, I'm paining a lot...

cheers,

abel.

abeltomillo

Hello all! again.. :)

Robin2, Hello, how r you? hope fine, let me to tell you something I've discovered on my implementation of "Yet another software serial". Hoping it no worries you ;) and not so long time since this develop. for you to know what can be happening, or not...

I'm experimenting some issues on reading by this implementation, it works 99% well. I explain to you all:

the problem comes, when the module slows a bit, then some bit is bad read. It usually happens at beggining of the INT1. So, it starts bad the counting of time, then the last bit is same as the before of the last.

So, If my module sends: 10101001, for example. Then sometimes, I am having 10101000 on my byte.

Do you know why is happening that? It's crucial to get a 100% safe data, as my implementation of the software for my robot, is very dedicated, and to implement a bit correction would result in a hard job.

Do you think I should down the baudrate? for getting more timing resolution, and then get more accurate data? maybe 100%?

I am using my module at 19200 bps. What do you think?

Hoping your answer,

have a good day all.

Abel.

Cheers.

Go Up