TX2 RX2... Am I missing something?

Nutsy
Posts: 237
Joined: Sun Jul 24, 2016 4:26 pm

Re: TX2 RX2... Am I missing something?

Post by Nutsy » Sat Aug 13, 2016 7:06 pm

edogaldo wrote: Did you try applying the formula changes at leasr for rpm? It should fix it.

Best, E.
Yep just put it in, and it works.

RPM still not working but i need to look into the data types again

edogaldo
Posts: 252
Joined: Fri Jun 03, 2016 8:19 am

Re: TX2 RX2... Am I missing something?

Post by edogaldo » Sat Aug 13, 2016 7:29 pm

If not using easy transfer, try Serial.parseInt() to read the integer values.

User avatar
Pito
Posts: 1385
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: TX2 RX2... Am I missing something?

Post by Pito » Sat Aug 13, 2016 8:02 pm

Another source of issues could be the difference in uart baudrates.
MapleM is crystal driven (afaik), the promini is resonator driven. When the uart speeds are more than 3-5% off, the data could get corrupted.
Moreover promini's 16MHz is not the best "baud" frequency, as for example the 115k2 is something like 111k in reality (-3.5%).
Last edited by Pito on Sat Aug 13, 2016 8:12 pm, edited 2 times in total.
Pukao Hats Cleaning Services Ltd.

Nutsy
Posts: 237
Joined: Sun Jul 24, 2016 4:26 pm

Re: TX2 RX2... Am I missing something?

Post by Nutsy » Sat Aug 13, 2016 8:05 pm

parseInt doesnt seem to work at all...

Nutsy
Posts: 237
Joined: Sun Jul 24, 2016 4:26 pm

Re: TX2 RX2... Am I missing something?

Post by Nutsy » Sat Aug 13, 2016 8:14 pm

Pito wrote:Another source of issues could be the difference in uart baudrates.
MapleM is crystal driven (afaik), the promini is resonator driven. When the uart speeds are more than 3-5% off, the data could get corrupted.
Moreover promini's 16MHz is not the best "baud" frequency, as for example the 115k2 is something like 111k in reality.
Ive tried setting lower speeds, I managed to get the MPH working again. Ive basically reverted my project back to how it was when I posted the haste bins...

*sleeps*

User avatar
Pito
Posts: 1385
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: TX2 RX2... Am I missing something?

Post by Pito » Sat Aug 13, 2016 8:18 pm

I would recommend you to start operate in more structured way, and, to troubleshoot your system bottom-up.
1. start small and try to elaborate the maple<--->promini communication - for that you need 5lines long sketches
2. when your basic communication works, start with parsing integers or Easy Transfer or whatever you need
3. then start to add your higher layers like schedulers or complex calculation..
;)
PS: the avr baudrates precision (provided you use crystals) tables are here http://wormfood.net/avrbaudcalc.php/
Pukao Hats Cleaning Services Ltd.

Nutsy
Posts: 237
Joined: Sun Jul 24, 2016 4:26 pm

Re: TX2 RX2... Am I missing something?

Post by Nutsy » Sat Aug 13, 2016 9:53 pm

Think i found the issue...
http://stackoverflow.com/questions/2479 ... connection
serial write has a max value of 255 1 byte... so my values im sending arnt compatible with the function... Now its time to work out how to get round it...

Nutsy
Posts: 237
Joined: Sun Jul 24, 2016 4:26 pm

Re: TX2 RX2... Am I missing something?

Post by Nutsy » Sat Aug 13, 2016 10:29 pm

FIXED IT!!!!!!!! yeah that was it... simple that you cant send numbers higher than 255 or one byte in serial... Found some stuff on how to split the int into two bites, then them separately and reconstructed on the ard... And it works :D thank fluff for that.

3 days it took me to find that problem eeesh

User avatar
rexnanet
Posts: 190
Joined: Wed Mar 16, 2016 10:34 am

Re: TX2 RX2... Am I missing something?

Post by rexnanet » Fri Sep 23, 2016 9:41 am

Were you still using Serial2 on PA2 and PA3 pins when it worked?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest