This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I have read your release library project " PM_tformat_lib" for T format interface encoder in C2000ware-MotionControl-SDK. In your sample library, you create - configure TILE1 block and using CLB4 module for this TILE block. With module CLB4 - TILE1, there are 3 CLB outputs:
- Out2 - GPIO7 - PWM4B - Clock to SPI,
- Out3 - connect to In7 - output enable for PWM4B
- Out4 - TxEN - connect to OUTPUT Xbar
My project needs to read two t format encoders, so i need to create and configure one more TILE block ( ex TILE0,.....) which implement the same to TILE1 above.
My concern: Is it OK if I still use CLB4 for this new TILE (because I want to use PWM4A - GPIO6 - for CLB Out2 and Out3, Out4 the same to TILE1) or I have to use other CLB module for this new TILE as CLB1, CLB2 or CLB3..?
Hi,
The subject matter expert assigned to this thread is out of office this week due to the the US holiday so you may not get a qualified answer until Tuesday or Wednesday next week. I apologize for the delay.
Regards,
Himanshu
Long,
For this project, the CLB tool configuration is for CLB Tile1. The implementer wanted to move the configuration to Tile4. Instead of changing the CLB tool configuration, they copied the generated source code and replaced CLB1 with CLB4 (this is Tile4).
That is
For your second t-format encoder interface you can use Tile1, Tile2, or Tile3.
Refer to this related post that mentions output options for a 2nd encoder interface:
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/933372
Regards
Lori
Dear Lori Heustess,
Thanks for your response, now I understand my issue. But I still have another concern. I am also building project which read data from Nikon A format encoder.
In my previous post, I asked about using CLB of C2000 to read Nikon A- format encoder and you recommend leverage open - source code from release library for T - format.
In source code for T format there is function which set up value for Match1, match2 and R0 register in Counter, HLC:
tformat_configureCLBLen((PACKET_BITS + 2), sendClks,receiveClks + dummySPIClks);
with sendClks = ABIT + PACKET_BITS + IDLE_BITS; and receiveClks = n * PACKET_BITS ;
the definition:
#define PACKET_BITS 10
#define IDLE_BITS 7
#define ABIT 1
I understand the defined values for ABIT, PACKET_BITS, IDLE_BITS and parameter sendClks, receiveClks pass into tformat_configureCLBLen () function
are based on T format protocol rule ( data length, send - receive timing, baudrate) - figure below:
But because I don't have the detail T format specification protocol, so I am confused when leverage when code for Nikon A format,
With my Nikon A format encoder: each transmission frame has length 18 bit, baudrate is also 2.5Mbs, and has signal timing like picture below
t1 = 7.2us (18 bit command), t2 = 1us(min), t3 = 1.5us(min), t5 = 3us, t6 = 21.5us (in this case three field- 18 bit data), t7 = 200ns = t8.
I don't understand clearly how to calculate the define value for IDLE_BITS and ABIT
So Is that ok if I do below:
#define PACKET_BITS 18
#define IDLE_BITS 7 =>> ??
#define ABIT 1 ==??
sendClks = ABIT + PACKET_BITS + IDLE_BITS; and receiveClks = 3 * PACKET_BITS ;
tformat_configureCLBLen((PACKET_BITS + 2), sendClks,receiveClks + dummySPIClks);
Thanks
Long,
Let me take a closer look and get back to you by end of Wednesday US time. Your screenshots didn't come through - can you repost them for my reference?
Regards
Lori
Long,
I did some google searching and found an encoder spec on the web. This details the T-format information and shows the number of bits in different fields. Hopefully this will help you translate between the two specifications. I'm not familiar with the specifics of a-format other than the communications is very similar. The number of bits, crc details, etc will need to be adjusted.
http://www.bianmaqi.com/uploads/201803/2018032819044985397.PDF
Best Regards
Lori
Lori,'
Thanks for your reply, I have read the encoder spec that you sent and compare with a format spec. And I also adjusted for number of bits and crc...... in source code library and try to test with a format encoder, but communication between MCU and encoder would be not working. I think there are some features in source code library of T format that I don't understand clearly so I want to make clear them:
1. About the defined value for ABIT, and IDLE_BITS, can you explain more about them? ( I mentioned in previous reply)
"I don't understand clearly how to calculate the define value for IDLE_BITS and ABIT
So Is that ok if I do below:
#define PACKET_BITS 18
#define IDLE_BITS 7 =>> ??
#define ABIT 1 ==??
sendClks = ABIT + PACKET_BITS + IDLE_BITS; and receiveClks = 3 * PACKET_BITS ;
tformat_configureCLBLen((PACKET_BITS + 2), sendClks,receiveClks + dummySPIClks); ""
2. About the hardware the difference I see your TIDM-1011 board using IC SN 65HVD78 as transceiver ( Which uses 3.3V supply voltage), but with my owned designed board I used IC SN75176 as transceiver (which uses 5 V supply voltage ). Is that oK?
by the way I also attach the spec of a format encoder, can you take a look and give me commend? Thanks
Long,
I'm investigating a similar implementation of a-format encoders (on F280049C). Any learnings you can share if you are successful would be greatly appreciated.
Ben
Long Pham Tan said:1. About the defined value for ABIT, and IDLE_BITS, can you explain more about them? ( I mentioned in previous reply)
In the t-format document, Figure 9 has a timing diagram.
Hopefully this will help:
Long Pham Tan said:2. About the hardware the difference I see your TIDM-1011 board using IC SN 65HVD78 as transceiver ( Which uses 3.3V supply voltage), but with my owned designed board I used IC SN75176 as transceiver (which uses 5 V supply voltage ). Is that oK?
As long as it meets the voltage requirements of your components/encoder.
Regards
Lori
Dear Lori,
I successfully read a - format encoder. Thanks alot for your support!
Another question, Like combination CLB - SPI on C2000 for reading t format, a format.
Is it normal if I combine CLB - McBSP ( work as SPI when using the clock stop mode) for reading t format, a format.
brs
Ben,
I successfully read a format encoder on F28379D. If you have any concerns when implement, I can share my learnings.
brs
Long Pham Tan said:I successfully read a - format encoder. Thanks alot for your support!
Great! thank you for letting me know.
Long Pham Tan said:Is it normal if I combine CLB - McBSP ( work as SPI when using the clock stop mode) for reading t format, a format.
I haven't tried using McBSP instead of SPI - I believe it is do-able, but there may be some limitations that I am not aware of. I found one related post discussing McBSP with SSI:
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/957651
Long,
I seem to have my interface mostly working with an A-format encoder. I'm having trouble with the CRC though. Did you have to make any changes besides changing the POLY1 to 0x1D?
Thanks,
Ben
Ben
"I seem to have my interface mostly working with an A-format encoder. I'm having trouble with the CRC though. Did you have to make any changes besides changing the POLY1 to 0x1D?"
- I have just only reused the function "PM_format_generateCRCTable()" for generate CRC - 8bit table from source code of library.
- I wrote my own function to calculate CRC 8 bits for answer message from encoder, and CRC 3 bits for command messages ( my a format encoder need command message with 3 bit CRC - you can see on the datasheet I attached)
- Yes, with CRC 8bit I changed POLY1 to 0X1D.
Brs,
Long