Hi,
I am trying to modify the TRF7960A firmware code to skip the UartGetLine function and read a single block (00) of a Iso15693 tag. To achieve this I am writing the following four commands directly to the buffer (in hex) and calling HostCommands after each buffer write. I have also removed the UartGetLine (line 108 Host.c) so that HostCommands is reading from the manually written buffer. host_control_flag is set to 1 and stand_alone_flag is 0, and McuCounterSet has been used to initialise TimerA.
0C0003041000210100000009000304F000000009000304F1FF00000B000304180020000000
The problem is this does not work, it seems identical to using the serial host up until the lack of an interrupt from the TRF7960A being returned on the last "read single block" command. I must be missing some kind of initialisation because debugging shows that the exact same commands are being sent to the TRF7960A when compared to using the USB interface. I have already be working on this far to long and we need a proof of concept so we can move forward with the product. I can provide the code if need, although there have been hardly any changes made. Any help would be greatly appreciated.
Thanks
Ryan
P.S. The TRF7960A EVM is configured for SPI mode
I still cannot find the problem. The only functions that are not running from the original firmware are, the UartGetLine; which only gets ride of the SOF (01) and converts the Ascii characters to Hex which is accounted for when manually entering the commands, and the UartRxHandler; which only sets host_control_flag to 1 for the first serial contact which is also manually set. I really need a response on this asap. If this is not the correct place to request further infomation would it be possible to advise, please! If there is a perference pay service that maybe would assist in providing this information we would interested in understanding the costs involved.
Below is the code I am running in the main routine after the initialisation settings in the sample firmware. The only other change that has been made is commenting out the UartGetLine() at line 108 of the Host.c file. With the last HostCommands() call the HostRequestCommand funftion is entered and the following bytes are written, (8f 91 3d 00 30 00 20 00) this should return the first block of the present RFID tag, however the TX interrupt is never sent from the TRF7960A. When these exact commands (with leading 01) are sent over the USB serial connection from a terminal program the block is read as it should be (TX interrupt fires). I do not understand were the difference lies. Could someone please enlighten me? it should be very easy to recreate.
// settings done McuCounterSet(); host_control_flag = 1; LED_ALL_OFF; LED_POWER_ON; buf[4] = 0xff; // "TRF7960 EVM" message in GUI HostCommands(); // device woks according host commands McuDelayMillisecond(100); buf[0] = 0x0C; buf[1] = 0x00; buf[2] = 0x03; buf[3] = 0x04; buf[4] = 0x10; buf[5] = 0x00; buf[6] = 0x21; buf[7] = 0x01; buf[8] = 0x00; buf[9] = 0x00; buf[10] = 0x00; HostCommands(); // set registers for ISO15693 communication McuDelayMillisecond(100); buf[0] = 0x0B; buf[1] = 0x00; buf[2] = 0x03; buf[3] = 0x04; buf[4] = 0x18; buf[5] = 0x00; buf[6] = 0x20; buf[7] = 0x00; buf[8] = 0x00; buf[9] = 0x00; HostCommands(); // requests data from first block of present tag
Ryan -
These sequences are host commands from the PC to the MCU, through the a VCP to UART bridge…
You should be sending from the MCU to the TRF not these command at all – they are translated by the MCU in the host.c file and execute other functions based on that.
BR-
Josh
---------------------------------------------------------------------------------------------------------Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
also -
if you have a look at the host commands document - this should explain what the PC ==> MCU communications look like ==> http://www.ti.com/lit/an/sloa141/sloa141.pdf
and the firmware reference should explain the other part (MCU to TRF) ==> http://www.ti.com/lit/an/sloa154/sloa154.pdf