Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

difference between sent and received array

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
P_Santos

Bascom Member



Joined: 07 Jul 2011
Posts: 114

PostPosted: Thu Sep 26, 2019 4:23 pm    Post subject: difference between sent and received array Reply with quote

Hello,
Anyone know what i make wrong?
I try to sent serial a 32 byte array from one pcb, to a display

see what will be sent
for ciclo = 1 to 32
reset watchdog
print #2, esp(ciclo) ; " ciclo " ; ciclo
reset watchdog
next

result is ok!
value ciclo
-----------
65 1
80 2
1 3
2 4
3 5
4 6
5 7
and so on

'sent it to display
Printbin #1 , esp(1) , 32
'
'
'
'receive on display
waitms 10
Inputbin , Rx_dados(1) , 32

'see what has been received
for ciclo = 1 to 32
print #2 , "ciclo "; ciclo ; " " ; rx_dados(ciclo)
next

Result:
loop value
--------------
ciclo 1 0 'here is the problem, the first byte is allready a 0 and the byte sequence have than a offset of 1, why this?
ciclo 2 65
ciclo 3 80
ciclo 4 1
ciclo 5 2
ciclo 6 3
ciclo 7 4
and so on

Can anyone help

Thanks
Regards
P_Santos


(BASCOM-AVR version : 2.0.8.1 , Latest : 2.0.8.2 )
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Fri Sep 27, 2019 8:29 am    Post subject: Re: difference between sent and received array Reply with quote

P_Santos wrote:
Anyone know what i make wrong?

1) You don't use code-tags, your intermixed code and message is a pain for the eye.
2) You don't show complete code, thus for example it's not understandable why a delay of 10ms is used, also it's impossible to check whether the UART's input buffer gets preloaded by some erroneous code.
3) You don't explain exactly what you want to do, it's guesswork that you have problems with a display and now you try to attach a controller instead to check what's going on. Or is the display connected with the receiving controller?
4) If you want answers, be better prepared and show more respect to potential helpsters.
Back to top
View user's profile
P_Santos

Bascom Member



Joined: 07 Jul 2011
Posts: 114

PostPosted: Fri Sep 27, 2019 10:27 am    Post subject: Reply with quote

Hi MWS,

Like the help:
When you use Printbin ar(1) , the whole array will be printed assuming that CONFIG BASE=1

It is solved, make change on the display code

Thank you

Best regards
P_Santos
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Fri Sep 27, 2019 11:20 am    Post subject: Reply with quote

P_Santos wrote:
Like the help:
When you use Printbin ar(1) , the whole array will be printed assuming that CONFIG BASE=1

It is solved, make change on the display code

It is quite likely that nobody understands from your reply what the actual error was.
You had 56 views and no answer beside mine, which is IMHO due to your lousy presentation of the problem.

After you got it solved somehow - guesswork would be Config Base = 0, or code different to what was shown - you do still not respect the viewers of this forum.
A forum is no litter-box where you can unload your junk and leave it this way, a forum is something other readers may draw information and benefit from.
At least I am not able to draw any benefit from your posts and remember, I was somebody willing to help.

If you like to give something back to the forum, then explain what your actual error was and how you did solve it.
Of course you don't have to respond this way, the same as I don't have any obligation to even notice your posts in the future.
Back to top
View user's profile
P_Santos

Bascom Member



Joined: 07 Jul 2011
Posts: 114

PostPosted: Fri Sep 27, 2019 4:52 pm    Post subject: Reply with quote

Hello WWS,

Sorry, i explain
I have a main pcb that read on power up a file with a lot parameters and store it on external eeprom
This modul is a master and works serial with aprox 50 slaves pcb's (displays and other pcb's)
To look failures and other staff, as to discharge parameters to all connected displays slave on the network,
i design a console with TFT display, now i can programm this parameters in one time to all conected slaves displays
The problem was, that printbin sent entire array based on Base 1 and on the receiver side i use lookup table that begin
with base 0, so i solve it on the display side, ignoring the first received byte, that solve the problem.
Thank you for your time

Regards
P_Santos
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Fri Sep 27, 2019 5:16 pm    Post subject: Reply with quote

P_Santos wrote:
The problem was, that printbin sent entire array based on Base 1 and on the receiver side i use lookup table that begin
with base 0, so i solve it on the display side, ignoring the first received byte, that solve the problem.

Thanks for the explanation.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum