MDB (Multi-Drop Bus) polling ..#2

Thread Starter

veyselozdemir29

Joined Jun 29, 2021
1
Okeey....just to clarify the things..
I'm using the pin 0 & 1 to send the commands to the device okey and that's the setup for that :

Code:
byte POLL_ADDRESS[3]{0x0B, 0x33, 0x12};

byte EXT_UART_BUFFER[37]; //incoming buffer for receive data from VMC
struct MDB_Byte MDB_BUFFER[37]; //incoming buffer for receive data from MDB peripheral
int EXT_UART_BUFFER_COUNT;
volatile int MDB_BUFFER_COUNT;

//MDB receiving flags
int rcvcomplete;  //MDB message receive completed flag
int mdboverflow;  //MDB message receive error flag




void MDB_Setup() {
  // Set baud rate with setbaud.h
  UBRR0H = UBRRH_VALUE;
  UBRR0L = UBRRL_VALUE;
  // Disable USART rate doubler (arduino bootloader leaves it enabled...)
  UCSR0A &= ~(1 << U2X0);
  // Set 9600-9-N-1 UART mode
  UCSR0C = (0<<UMSEL01)|(0<<UMSEL00)|(0<<UPM01)|(0<<UPM00)|(0<<USBS0)|(1<<UCSZ01)|(1<<UCSZ00);
  UCSR0B |= (1<<UCSZ02); // 9bit
  // Enable rx/tx
  UCSR0B |= (1<<RXEN0)|(1<<TXEN0);
}

In other hand the cashless can get mycommands correctly and reacts like it should be. When I want to read the poll responses from the device and using the SoftwareSerial I m forced to use other pins okeey (10 and 11 for example ).
But in this case I have already attached the UART device pins in 0 and 1, how can I get the responses on the pins 10 and 11 ?

Hi, I am trying to communicate with mdb with similar hardware. I wonder if you were able to solve your problems?

Mod:New thread, link to old,
https://forum.allaboutcircuits.com/...verything-else-works-fine.197954/post-1911530
 
Last edited by a moderator:
Top