RFID RDM6300 with arm cortex-m7 same70 atmel studio

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello , I want to add RFID RDM6300 to my project to read specific tags and do a set of actions depending on which tag is scanned

so I was looking if there's any c library for atmel studio I can start with for this 

thanks a lot .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

well as no1 answers I'll add this question

is it possible that I use the same library I'm using for barcode for this RFID ?

they both work via UART and 9600 baud rate

is there something I should change?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

if the library supports the tag read commands, it should be possible.  if the library is open source, extending it might be easier than starting over.

 

However, if it is just 9600 baud uart, starting from scratch may not be a bad choice, as you will know exactly what it does.

jeff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jcandle wrote:

if the library supports the tag read commands, it should be possible.  if the library is open source, extending it might be easier than starting over.

 

However, if it is just 9600 baud uart, starting from scratch may not be a bad choice, as you will know exactly what it does.

hey man thanks for answer

well the barcode library I'm using is pretty simple having .h and .c which I need exactly with 3 functions only , barcode_start , barcode_stop , configure_uart

but ofc it doesn't support the tag read commands it just reads 1D barcodes and works perfectly , but I think this will be too similar to reading tags(maybe I'm wrong?) .

I think both configuration will be the same , I'll try to use it and see what I should add

I'll let you know the results

thanks again

Last Edited: Thu. May 17, 2018 - 07:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can't get it to work yet , can someone help me using the uart commands to read the tags numbers from serial?

I'm connecting the tx , rx to the uart1 in same70 and pwr gnd

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mostafa,

 

Can you sketch out the system and provide a few details? 

Is the SAME70 system powering the RFID or are they independently powered?

Are you sure that you have Tx <--> Rx and vice versa?

If you write a simple flood test on the UART, are you seeing signals on the RFID Rx pins?

 

These are for the ATSAMD51 but should be easy to port:

 

// send 'a' forever with no breaks
void TestSlamUART0()
{
	SERCOM1->USART.DATA.reg = 'a';

	while (1)
	{
		while (!SERCOM1->USART.INTFLAG.reg & SERCOM_INT_DRE_MASK) // DRE bit 
			;
		SERCOM1->USART.INTFLAG.reg = SERCOM_INT_DRE_MASK; // clear it
		SERCOM1->USART.DATA.reg = 'a';
	}

}

// return the received character forever
void TestEchoUART0()
{
	while (1)
	{
                // this used my circular buffer and ISR code, 
                // I am editing it in place so you may need to fix it
		while (!SERCOM1->USART.INTFLAG.reg & SERCOM_INT_RXC_MASK) // RXC bit 
			;
                char ch = SERCOM1->USART.DATA.reg;
		while (!SERCOM1->USART.INTFLAG.reg & SERCOM_INT_DRE_MASK) // DRE bit 
			;
		SERCOM1->USART.INTFLAG.reg = SERCOM_INT_DRE_MASK | SERCOM_INT_RXC_MASK;  // clear it
		SERCOM1->USART.DATA.reg = ch;
	}
}

 

Also, you could buy a couple USB to serials and put their Rxd lines onto each serial line.  This will let you snoop on the traffic both ways.

jeff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hey I got it to work but I'm getting wrong tag numbers

when the tag is 0008835080 it gives me 060086D00858 

and when it's    0008654744 it gives me 4800840F985B as a string at the serial monitor from UART1 when I make uart_read

here's my UART handler function

void UART1_Handler(void)
{
	uint32_t Status = uart_get_status(CONF_UART1);
	unsigned char data;

	if (Status & (UART_SR_OVRE | UART_SR_FRAME | UART_SR_PARE)) {
		CONF_UART1->UART_CR = UART_CR_RSTSTA;
		//printf("Error \n\r");
	}
	uart_read(CONF_UART1,&data);

	if ((Status & 0x1) == 1){
		if(data == '\r')
		{

			buf_RFID[RFID_data_counter] = data;
			buf_RFID[RFID_data_counter+1] = '\0';
			RFID_data_counter = 0;
			RFID_DATA = true;
		}
		else{

			buf_RFID[RFID_data_counter] = data;
			RFID_data_counter++;
		}
     printf("%c", data);
	}
}

maybe it's because I'm reading data as "char" ? but i think digit should appear as digits even if the variable is char or am i wrong?

Last Edited: Mon. May 28, 2018 - 11:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found that this RFID module sends hex value and then it's converted to ASCII as I wrote in previous comment

now I have to convert from ASCII to decimal and it's done

EDIT : I've done it and converted it to decimal using strtol( ,     , 16) 

Last Edited: Mon. May 28, 2018 - 01:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

excellent!

jeff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jcandle wrote:

excellent!

thanks a lot for your help man :)