Can Command Terminator be set programmatically?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I would like to change or enable/disable the command terminator at runtime.  Is this possible?

0 Likes
20 Replies
Anonymous
Not applicable

This would be for the RX UART

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

What do you mean by "command terminator" ?

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

...and for the PSoC1, I presume

   

The command terminator is an EQU in the file UART_1.INC, so it cannot be changed at runtime.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

In global properties for the RX8 is a flag for enable of the command buffer.

   

I would think, but cannot find in TRM, that a register write would handle this.

   

If no one else comments post a CASE to get answer -

   

 

   

    

   

          

   

To create a technical case at Cypress -

   

 

   

www.cypress.com

   

“Support”

   

“Technical Support”

   

“Create a Case”

   

 

   

You have to be registered on Cypress web site first.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Dana,  Maybe the use of the buffer is controlled by the interrupt enable?

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Thats a question to ask in the CASE filing.

   

 

   

If you would not mind post back to forum what you find out.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Dana,  What is TRM?  Thanks for suggesting to open a case.  I'll do that tomorrow.

   

Bob, PSC stands for Power System Control...  I work for a power company.

   

Tom

0 Likes
Anonymous
Not applicable

TRM = Technical Reference Manual

   

Here are the links to PSoC1 related

   

http://www.cypress.com/?id=1573&rtID=117

   

Enjoy

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Probably I didn't state it quite clearly, I went through the sources and found out:

   

In the interrupt handler when a byte is received it is compared to the command terminator

   

The command terminator is an assembly EQU (equate) so it caqnnot be changed (except by modifying code in flash)

   

Easiest way out: Wirte your own interrupt handler and disable the original one. This may sound more complicated than it is. In PSoC1 there are some hints to obey to get a handler to work, but if you'd like to go this way we are going to get you through.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

In PSOC Designer if you go to "Help", "Documentation", there are Architecture TRMs

   

there. Note there is also a Register TRM for each family, that you have to get at cypress.com

   

This covers all the registers used to configure PSOC.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Thanks!  You've all been so very helpful.  Motivated by the discussion, I found the equate and then took a look at the interrupt handler code.  I thought about writing my own handler.  Maybe I could move the section that states "Place your code here" in a different section of the code.  That way I could add my modifications  without having to re-write (copy-paste) the whole thing.  I suppose that notice is there so that it preserves the user modifications when the project is re-generated.  I suppose that won't work because the modified code will end up in a different section of the regenerated code.

   

I want to overlay modbus protocol on top the UI that I developed.  I was going to implement Modbus RTU which requires binary transmissioin.  That is why I wanted to diable the terminating character.  Instead, now I think I will implement ASCII modbus.  ASCII Modbus commands terminate with CRLF so it will be compatible with the UI.  If I do need binary transmission then it looks like my easy option is to disable the interrupt and poll for new characters to arrive.  My challenge will be to read them as fast or faster than they arrive.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Did you open a CASE on this, I am curious to know if this

   

can still be done by register writes. If you did not then I will.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Dana- I think Bob's reply sums it up.  Since it's an EQU then that parameter is hard-coded in the flash.  One would have to know where the value(s) appear in flash and then re-write them.  I think this would require a block write.  This yields a 'find another way' option which is: Find a way to use utilize the terminator ; Don't use the buffer; Re-write the interrupt routine.

   

I did not open a case and won't be in a position to do so for a few days.  If you can and will, I'd appreciate it.  Please post the response.

   

-Tom

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

CASE filed, I will update when answer comes in.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Bobs answer confirmed, from tech support -

   

 

   

Hi Dana,

Enabling of RxCmdBuffer does not involve a register,It uses a constant definition as given below and hence it cannot be changed at run time.

RX8_1_RXBUF_ENABLE:                         equ   1    //Enabling Command Buffer

RX8_1_CMD_TERM:                              equ  dh   //Command Terminator

You can find this in inc file of Rx8
Please let me know if you need more details/have further queries.

Best Regards
Sujay
 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Did it really take 8 days to get an answer? It has been much faster before.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Yes.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Thanks Dana,  We better stick with Bob!  He beats 8 days anytime. 🙂

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Dana's request for a MyCase was not a bad try: Sometimes some users request a similar change and sometimes Cypress has got a hand-wovwen solution, workaround or a qnd (Quick 'n Dirty) approach already out-of-the shelf. I presume the long delay had to do with some exhibitions taking place at that time binding a lot of manpower.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The underlying reason CASE filed is so much of the PSOC architecture

   

has a foundation of registers to configure the HW, so it was just to confirm

   

there was no register available for the termination problem. Also the

   

documentation, like TRM, is not perfect, kind of like finding buried cables

   

and pipes in a city. There are docs, drawings, but they are imperfect at best.

   

 

   

Kind of a cross check,. Eioght days is an abnormal response time, overnight more

   

typical for Cypress tech CASE response time.

   

 

   

Regards, Dana.

0 Likes