Go Down

Topic: SSP & SIO serial protocol with Mega 2560 (Read 424 times) previous topic - next topic

zakizakaria

Jul 27, 2017, 07:42 am Last Edit: Jul 27, 2017, 07:51 am by zakizakaria
hi guys.

I'm trying to communicate an arduino mega 2560 with BV100 note validator. This note validator can support many interface protocol like sio, ssp, pulse, cctalk and many more.

i already read and follow this thread in the forum and use the sketch and schematic given, i also setup my BV100 to SIO mode but its not working.

https://forum.arduino.cc/index.php?topic=125119.0


output at serial monitor just 0 when i insert MYR1, MYR5 MYR10 like this:

0
0
0
0
0
0

i also try to print in dec, hec, bin.
when i change the baudrate in sketch and at monitor to 300, weird words showing on serial monitor.

i'm sure that i've follow the schematic correctly. Common ground connected.



Can someone explain me what different with this two protocol. and how to coding to receive and transmit the data to this note validator using this two protocol?

Which protocol should i use to when i connect TX pin from validator to RX pin on Arduino directly?
or any suggestion to use RS232 shield?

i'm not really good in communication  :(
hope someone can help me finish this project. sorry for my bad english

here the codes i use:

Code: [Select]

void setup()
{
 Serial.begin(9600);
}

void loop()
{
 if( Serial.available() > 0)
 {   
   Serial.println(Serial.read());
 }
}



pylon

The thread you linked to connects to a BV20, not a BV100.

Post an image of the schematics you use, I cannot find a schematic picture in that thread.

Quote
Can someone explain me what different with this two protocol. and how to coding to receive and transmit the data to this note validator using this two protocol?
Which two protocols? You mentioned only SIO.

Quote
or any suggestion to use RS232 shield?
No, the manual (which you forgot to link to!) explicitly states that the SIO interface has TTL levels.

As you have a Mega2560 why do you use the first serial interface to communicate with the BV100? That way trouble is guaranteed.


zakizakaria

hi mr pylon, thanks for the reply.


here the link for BV100 manual:

https://drive.google.com/open?id=0B3c_VPBO9Qq3UXVvZWF1MHlUYkE


page 8     -->  protocol that available on BV100
page 10    --> connector pins detail
page 18    --> detail about SIO protocol on BV100



this my connection between mega and BV100:
https://drive.google.com/open?id=0B3c_VPBO9Qq3NFd4MlRmbXlneVE


as you mention SIO has TTL levels, so i dont need rs232 shield when im using SIO. am i right?
thanks again for your reply!

pylon

Quote
as you mention SIO has TTL levels, so i dont need rs232 shield when im using SIO. am i right?
Correct.

How did you setup the SIO mode on your BV100? Did you print the mentioned configuration cards and used it?

Quote
this my connection between mega and BV100:
If you have a Mega, please don't use pin0 (RX0) for the BV100 connection but for example RX1 (pin 19). You have to change the serial object for the reception to Serial1 in the code.

zakizakaria

hi pylon, thanks again for your reply.

i setup bv100 to SIO using software ITL Validator Manager that i've download from official website.

this BV100 already programmed in MDB interface by another programmer before. i think  using SIO is simpler like using HC06 bluetooth(i experienced using this module before).
so i want to change interface to SIO.


in the software, i open tab that named "Program"
here the picture:
https://drive.google.com/open?id=0B3c_VPBO9Qq3cFZuU28wNWJKb1E


then at bottom right i choose SIO interface and click "Set Interface" button.
https://drive.google.com/open?id=0B3c_VPBO9Qq3cFMxSk1wTjdiQ00


then the software tell that machine already in SIO mode.
any step missing? or i also need use configuration card?


what should i do to make this machine working with arduino? anyone experienced with this machine?



i really appreciate your reply, mr pylon.

pylon

Did you read the last two sentences in my last answer?

zakizakaria

Yes. I already change to use extra serial pin on mega. I also try on my uno and nano by use software serial library :(

Thanks again for your reply, pylon

pylon

Quote
I also try on my uno and nano by use software serial library
That's a rather bad idea. SoftwareSerial is a crippled piece of software. You should use it only if you really have no chance to do your project an other way.

Quote
Yes. I already change to use extra serial pin on mega.
Then please post a new wiring diagram and the changed code.

zakizakaria

the wiring same like before. i just change from 0(rx) to pin 19(rx) on mega. and the the code from
"Serial.begin" to "Serial1.begin"
"Serial.available" to "Serial1.available"

pylon

Quote
the wiring same like before. i just change from 0(rx) to pin 19(rx) on mega. and the the code from
"Serial.begin" to "Serial1.begin"
"Serial.available" to "Serial1.available"
In that case you missed the Serial.read() that should be a Serial1.read().

Is it so much work to copy the complete new code to the forum?

zakizakaria

here my code

Code: [Select]

//#include <SoftwareSerial.h>

//since 8 and 9 don't work on the Mega
//SoftwareSerial BVpin(10, 11);  //rx, tx

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
  Serial.println("ready");
}

void loop() {

  if (Serial1.available()>0)
  {
    int fromBV = Serial1.read();
    Serial.print("raw: "); Serial.print(fromBV);
    Serial.print("  BIN: "); Serial.print(fromBV, BIN);
    Serial.print("  DEC: "); Serial.print(fromBV, DEC);
    Serial.print("  OCT: "); Serial.print(fromBV, OCT);
    Serial.print("  HEX: "); Serial.println(fromBV, HEX);
  }
}

pylon

And what output do you get with this code?

zakizakaria

also same like before. only get "0"

thanks pylon for your reply. i really appreciate that.

currently i using pulse protocol interface at pin 3 arduino. its working.
but i just want to know why its not working when i use SIO interface. thats why i still on this thread

pylon

Quote
also same like before. only get "0"
I cannot believe that, no with above code. I would at least expect some words "raw", "OCT", "BIN", etc.

Do you have the possibility to use a scope or logic analyzer?

zakizakaria

I cannot believe that, no with above code. I would at least expect some words "raw", "OCT", "BIN", etc.
i mean i get "raw 0"

"fromBV" is 0

Go Up