ATmega8A with EM-18 RFID Module Data Transmission Error

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

 

Hello everyone,

I am working on RFID based system with ATmega8A. I met a problem. I cant receive read data. My circuit schema is below (Figure 1). And I connected TX to RX, SEL to +5V, GND to GND, VCC to +5V for EM-18 module. Also, EM-18 pinout is below (Figure 2). EM-18 working with UART communication. I'm sure I assigned the appropriate registers correctly (UCSRs, UBBR and etc.).

because i can get data with PL-2303 USB-TTL converter. Can you help me?

Figure 1. Circuit Schema

 

Figure 2. EM-18 RFID Reader Module Pinout

 

Last Edited: Tue. Jan 14, 2020 - 12:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

FYI - 

 

This really does not belong in the XMega forum. Hopefully, a moderator will move it.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

admcmly wrote:
ATmega8A

So why post it in the Xmega forum?

 

As ka7ehk wrote:
This really does not belong in the XMega forum

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

admcmly wrote:
i can get data with PL-2303 USB-TTL converter.

You mean data from the microcontroller to the PC, or data from the  EM-18 to the PC ?

 

See this thread for tips on debugging serial comms:

 

https://www.avrfreaks.net/commen...

 

And See Tip #2 (in my signature, below; may not be visible on mobile) for the commonest problem in serial comms ...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

You mean data from the microcontroller to the PC, or data from the  EM-18 to the PC ?

 

See this thread for tips on debugging serial comms:

 

https://www.avrfreaks.net/commen...

 

And See Tip #2 (in my signature, below; may not be visible on mobile) for the commonest problem in serial comms ...

awneil wrote:

You mean data from the microcontroller to the PC, or data from the  EM-18 to the PC ?

 

See this thread for tips on debugging serial comms:

 

https://www.avrfreaks.net/commen...

 

And See Tip #2 (in my signature, below; may not be visible on mobile) for the commonest problem in serial comms ...

 

Sorry, i am new at this forum.

 

awneil wrote:

You mean data from the microcontroller to the PC, or data from the  EM-18 to the PC ?

 

See this thread for tips on debugging serial comms:

 

https://www.avrfreaks.net/commen...

 

And See Tip #2 (in my signature, below; may not be visible on mobile) for the commonest problem in serial comms ...

 

EM-18 to microcontroller. Thank you i will look this.

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

admcmly wrote:
Sorry, i am new at this forum.

Here's a tutorial on how to post replies:

 

https://www.avrfreaks.net/forum/man-forum-how-reply-post-forum

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you

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

First thing......there is NO RxD line on the EM-18 as you have in your schematic

 

Second thing..... There are NO CTS or RTS lines on the EM-18 as you have in your schematic

 

Third thing......you MUST connect the SEL pin to +5v for 232 communications.  Leaving it floating may set it for Wiegand output.

 

Fourth thing....Are you SURE that the EM-18 outputs TTL level signals?  (I checked, and I know the answer to this)

 

 

 

East Side Jim

 

 

 

 

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

  I know, there is no RX pin, only i was connect. And EM-18 have TX pin, i was connect this pin to rx of microcontroller. I was connect SEL to + 5V. And, I new at microcontrollers, When I saw the TX pin, I thought I'd read it from the RX. Is it wrong?

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

jgmdesign wrote:
First thing......there is NO RxD line on the EM-18 as you have in your schematic

 

Second thing..... There are NO CTS or RTS lines on the EM-18 as you have in your schematic

And figure 2 in the OP actually shows that!

 

 

 

 

Also:

 

Q1 etc in the schematic is drawn "upside down" - the positive supply should always be at the top; GND at the bottom.

 

No supply connections (or bypass caps) to the AVR

 

What frequency is the crystal ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A schematic should accurately depict the connections you have!

 

admcmly wrote:
I new at microcontrollers,

Perhaps you should start with some basics ?

 

See Tip #6.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

admcmly wrote:
I know, there is no RX pin, only i was connect. And EM-18 have TX pin, i was connect this pin to rx of microcontroller. I was connect SEL to + 5V.

 

First rule of electronics.....Schematics M U S T  represent the ACTUAL Circuit.  When Microchip took over they deactivated our crystal balls and stopped shipments of Flooby Dust, so none of us has our magical abilities anymore.

 

admcmly wrote:
When I saw the TX pin, I thought I'd read it from the RX. Is it wrong?

Correct

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

In the result, currenct from collector to emitter I think it does not matter. Microcontrollers are not have supply connections in ISIS Proteus. Crystal frequency is 8MHz

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

Thank you but i must do this circuit. Isn't it hard to actually do?

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

admcmly wrote:
Thank you but i must do this circuit.

 

THen at least draw it properly.

 

admcmly wrote:
Isn't it hard to actually do?

 

I'm done.  Over and out.......

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Proteus has virtual test instruments. i’d suggest you use them to view the virtual electrons.

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

You are right.

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

Okey. Anymore, i will do that. Can you give me ideas why I can't read the data.

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

admcmly wrote:
i must do this circuit

Why "must" you - what is forcing you?

 

Clearly, if you "must" do this, then you need to understand the basics in order to be able to do it!

 

Is this a school / homework assignment ?

 

admcmly wrote:
Can you give me ideas why I can't read the data.

What, exactly, have you tried ?

 

Have you carefully studied the  EM-18 datasheet to learn how it works, and how to use it correctly ?

 

Have you searched for Application Notes, examples, tutorials, etc on how it works, and how to use it correctly ?

 

As already suggested, have you used the simulation, debugging, and virtual instrument features of Proteus to investigate what is happening?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

admcmly wrote:
In the result, currenct from collector to emitter I think it does not matter

That's not the point.

 

The point is that a schematic should clearly communicate the design to other human readers.

 

Communication is far more effective if you stick to the normal, well-established conventions.

 

admcmly wrote:
Microcontrollers are not have supply connections in ISIS Proteus

That doesn't sound right!

 

Labcenter wrote:
Proteus Design Suite is found in High Schools, Colleges and Universities across the world, teaching electronics, embedded design and PCB layout to tens of thousands of students each year.

You cannot possibly so a PCB layout if things like supply connections and bypass capacitors are not there!

 

And, again:

 

jgmdesign wrote:
First rule of electronics.....Schematics M U S T  represent the ACTUAL Circuit

Remember: the schematic that you post is the only information that we have about your circuit!

 

admcmly wrote:
Crystal frequency is 8MHz

So put that on the schematic - just as you've put the resistance values on the resistors and the capacitance values on the capacitors.

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Firstly, thank you for your reply.

This project for school project. Therefore, i must do this.

 

Yes, i tried multiple ways. I bought module again, maybe it's broken. And I was read EM-18 datasheet, I tried the circuit there. In the internet have not much documentation for EM-18 applications. I used simulation for this circuit at Proteus. Working there right.

 

Thank you.

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

admcmly wrote:
This project for school project.

So you should be asking your teachers for help!

 

It will be far easier for them to help you as they can sit with you, and see exactly what you have, and see exactly what you're doing, and see exactly what's happening - we can do none of that!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are correct for clearly communication.

 

I can't see VCC and GND pins at Proteus simulation screen.

 

You are right, i forgot to add crystal frequency.

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

you're right but i wanted to ask here first. Thank you for all.

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

admcmly wrote:
for clearly communication

And, presumably, less of a language barrier.

 

 

Quote:
I can't see VCC and GND pins at Proteus simulation screen.

Proteus is nothing to do with Microchip - you need to go to Labcenter for help with Proteus:

 

https://www.avrfreaks.net/commen...

 

https://www.avrfreaks.net/commen...

 

 

Or, again, speak to your teachers - presumably it's the school that has provided you with Proteus ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will do this, thank you again.