cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

RoCa_1222471
New Contributor II

Good morning, I need to manage a serial interface using a sort of CSMA/CD detection feature at single bit level. All devices are master and stop thier transmission every time a collision is detected: each master send and read back what is transmitted on the line. The low level on the bus detain priority. Is there any example or is it possibile to find a specific component to obtain this scope? Thank you

0 Likes
17 Replies
SampathS_11
Moderator
Moderator

Would CAN be a suitable solution? If CAN can be considered, then PSoC4M and PSoC4L family have CAN interface.

Best regards,

Sampath Selvaraj

0 Likes
RoCa_1222471
New Contributor II

I could take in account CAN bus too, but I need to verify (also cost of the component). I was thinking instead to use the enable logic of Tx pin to stop transfer and using an internal IRQ timer sincronized with my transmission verify if the returned bit is equal to the transmitted one. Could be possible to modify a UART component to assolve this request?

Thank you 

0 Likes
RoCa_1222471
New Contributor II

I verified, the standard CAN bus has got a decoding scheme complitely different respect to the UART start+8data+parity+stop and impedance line requirements seems not be compliant with mine. Suppose I need to interface with an already existing device already using a UART with CSMA detection and I need to replicate this kind of interface also over a Cypress device: which solution do you suggest? Is it possible to generate an hardware internal logic to modify the UART component to assolve to this task?

Thank you

0 Likes
SampathS_11
Moderator
Moderator

Modifying an existing UART component will be the easiest way to go. However, you should be thorough with the component architecture. Hence, I request you to kindly refer to the PSoC Creator Component Author Guide. Meanwhile, we can wait to see if anybody else has a better solution.

Best regards,

Sampath Selvaraj

0 Likes
RoCa_1222471
New Contributor II

Please, in your opinion, could be possible to modify an existing UART component using Verilog Internal component schematic or the new component must be built from the beginning? An approach could be to use and XNOR port logic between Rx and Tx signals to verify/compare if trasmission must be stopped because of a collision event and this check must be executed before the end of next bit transfer event.

Once created the new component, is it possible to import it into PSOC4000S PSOC4100S devices not supporting UDB internal blocks?

Thank you

0 Likes
odissey1
Honored Contributor II

RoCa,

I believe that PSoC4000/4100 series do not support custom components. It has to be plain C code.

/odissey1

0 Likes
RoCa_1222471
New Contributor II

For which PSOC4 families custom component support is available? And what do you mean with  " It has to be plain C code" ? I can't modify UART component for these devices?

Thank you

0 Likes
odissey1
Honored Contributor II

RoCa,

For 4000/4100 devices Cypress allows only Cypress-supplied components. That means that one can only play around standard UART by using own C-code. No custom components allowed.

I believe that byte-by-byte transmission with verification of echo-byte can be accomplished in code.

/odissey1

0 Likes
RoCa_1222471
New Contributor II

I think it is not possible to solve issue using only software without external hradware logic because when Tx buffer register is loaded it can't be stopped at collision detection.

0 Likes
MotooTanaka
Esteemed Contributor

Hi,

Although it depends on how fast the UART must be,

and how much CPU MIPS you can shell out for the task,

writing a software UART might be another option.

Note: I'm meaning that without using hardware component,

and using a couple of GPIOs.

moto

0 Likes
RoCa_1222471
New Contributor II

Thank you to your answers, I replay to everybody:

DheerajK_81

I need to clarify if UART component set in SmartCard mode with Tx lost arbitration could be used for my request: is single bit collision event sampled at the middle of the transferred bit? In my case Uart Rx and Uart Tx are both connected to the same bus system for long distances communication where some line delay are present, instead I think SmartCard Uart mode is conceived for on board component communication using fullduplex communication.

To use SmartIO I find issue to drive internal signals using firmware because a direct control register component is not available on PSOC4100S devices.

JuRo_640956

All your suggestions could be valid but I'm not implementing a new communication but I only need to interface a  new device to other devices already implementing an UART with CSMA collision avoidance, so I can't use a different solution instead of UART standard.

Motoo Tanaka

I think this could be the easiest solution but to manage single bit transfer directly using single GPIO without hadware usage it is an issue when application require concurrent other Isr interrupt execution. To use UART peripheral (or others) could lighten micro to do these tasks and in that direction I was looking for suggestions.

0 Likes
RoCa_1222471
New Contributor II

Another option could be to sample every tranferred bit-to-bit data using an input capture timer synchronized (at the middle of each bit) with outputting bit stream and when collision is detected to kill data transfer using an external logic port. However to do that I need to know when a new reception trigger (start bit interrupt detection) to be sure not to start a new trasmission when a reception is in progress (this information in my opinion is not available using PSOC UART component: I was thinking to use instead a GPIO edge detection interrupt to recognize start bit incoming but a spike over the communication line could be wrongly detected as a start of communication). 

Thank you

0 Likes
PSa_795526
New Contributor II

Hi RoCa,

For an XOR(or XNOR) implementation between the Tx and Rx signals to detect collision, you can consider using the SmartIO block available in the PSoC4000S/4100S devices that you need to use.

Based on the XOR output, an interrupt can be generated and in the interrupt routine, the drive mode of the UART Tx pin can be changed to High-Z so that the rest of the bits(following a collision detection) are not transmitted out of the chip.

But the interrupt latency must be well under one bit period(or half bit period?) of UART so that the appropriate action on collision detection can be taken in time.

Best Regards,

Prem Sai

0 Likes
RoCa_1222471
New Contributor II

I'm trying to implement this solution using your suggest but I have an issue: on PSOC4100S devices not supporting control reg component is it possible to directly access  internal signals by firmware code?

Thank you

RoCa_1222471
New Contributor II

I found PSOC4 UART component can be configured in SmartCard Mode and so a Tx lost arbitration feature is enabled. The single bit check sampling to verify arbitration lost is done at the middle of the bit?

DheerajK_81
Moderator
Moderator

Can you please attach your project and let us know what the current issue it is that you are facing?


Regards,
Dheeraj

0 Likes
JuRo_640956
New Contributor II

Just to mention (although i dont like I2C)

Another serial standard supporting some kind of arbitration is I2C in multi master mode.

Another interesting link regarding your "impedance line requirements" and CAN might be

https://www.mikrocontroller.net/attachment/28831/siemens_AP2921.pdf

0 Likes