NJC 17 Posted September 9, 2010 Share Posted September 9, 2010 Hi NJC, I hooked up my MSP430F2013 to an oscilloscope to see what was going out and coming in; I've verified that I'm sending out the right command at the 9600 baud rate (I just reconfigured the baud rate for the RFID reader instead). However, I'm still not getting any response from the Skyetek M4 reader, which uses a UART/TTL interface. I think it may be due to the fact that they ask to wait at least 40 ms before the host seeks a response from the reader. To deal with that scenario, I decided to disable to RXD interrupts until just after transmitting the 11 bytes in sequence, and to have a for loop that'd run for approx 40 ms. Still no response, though--what could I be doing wrong? I also tried it with the RXD still being enabled at the beginning as usual, and just having the for loop. I've verified that the logic low and high voltages are same for the MCU + the RFID reader, and to measure the baud rate, I just ran the lines TXByte = 0xFF; Transmit(); in a while(1) loop and measured the time width of the square wave that I'd see on the oscilloscope--it would correspond to the time taken to send 9 bits, since the stop bit is just after the transition from low-high. Am I calculating the baud rate correctly? I calculated that I'd need the width of the 9bit segment to be 940 us, and modified Bit_time till I measured 940 us as the width on my oscilloscope. I'll be writing my answer here right after starting this topic. Quote Link to post Share on other sites
NJC 17 Posted September 9, 2010 Author Share Posted September 9, 2010 The 40ms should not be a problem, even if the device is waiting for an RX the entire time, unless there is another device sharing the wire. Have you tried sending the correct command and then checking with the oscilloscope if the reader is sending anything back at all? If it is not, then it is one of two things. 1. You have the command wrong. 2. The device is not receiving the command even though it is 100% correct. There are a few things that can cause the device to not receive a correct command. The first is power, do you have the power lines hooked up correctly? Are the voltages the same? I've verified that the logic low and high voltages are same for the MCU + the RFID reader, and to measure the baud rate, I just ran the lines TXByte = 0xFF; Transmit(); in a while(1) loop You mentioned that you checked them, how did you check them? Do you have the grounds tied together? If there is no reference voltage shared between the two devices it's possible that nothing will be received. It's good that the baud rate is working correctly. :-) A small tip though, is to use 0x55, in a loop, this will generate a square wave with the period being twice the bit time. 0x55 is 0b01010101, adding the start and stop bits it is 0b1010101010; this is the method I use to test my UARTs when things are wrong since it also checks each individual bit. Also keep in mind that the timing does not need to be 100% perfect, if I remember correctly there is a 10% tolerance built into the standard (but I could be wrong). I hope this helps a bit, and I hope you don't mind that I brought our discussion here, my response was a bit too large to be written on my blog. Best of luck, NJC _________________________ http://msp430launchpad.com Quote Link to post Share on other sites
bluehash 1,581 Posted September 9, 2010 Share Posted September 9, 2010 NJC, Can he bypass the MSP430 for now and check the RFID command set using a terminal. That would allow him to unit test his RFID at the least. Thanks for asking it here at the forums. Quote Link to post Share on other sites
NJC 17 Posted September 9, 2010 Author Share Posted September 9, 2010 Great idea bluehash. It is definitely possible, and might be the best way to test this. I can't promise how anything will react with the weird UART on the LaunchPad, for this I would use my FTDI chip. That being said its still possible to test with the LaunchPad. Just make sure you tie the ground pins together between the RFID reader and the Launchpad, and then tie the RX and TX pins between the two devices correctly. The hardest part will be making sure you send the data correctly from the terminal program. Realterm allows you to do this easily, by specifying hex commands which you can send. I hope the author of the question will find this thread. I replied a bit later than normal to his post on my blog. NJC _________________________ http://msp430launchpad.com Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.