USB RS485 SPI hub (cy8c24894-24ltxi)

A catchall for PSoC Mixed-Signal Array (microcontroller) discussions not captured by the other forums.

Moderator: ericb

USB RS485 SPI hub (cy8c24894-24ltxi)

Postby Mipo01 » Mon Nov 11, 2013 3:37 am

Hi guys,

I would like to ask about your opinion. I have a project to reprogram (enhance functionality) cy8c24894-24LTXI as a hub to arbitrate communication between PC(usb), Controller(rs485) and FPGA(spi). Functionality should be like when you send packet from PC, it should go to both spare buses. Same for every bus, e.g. from SPI to USB&RS485, from RS485 to SPI&USB. I am not sure whether all those buses are buffered in chip and whether is possible to do it with this chip. I study datasheets and thinking right now about prioritization and how to drive communication between those buses.

Thank you very much

Best
Michal
Mipo01
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 16
Joined: Wed Oct 30, 2013 5:41 am

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby bobmarlowe » Mon Nov 11, 2013 8:07 am

Sorry, but you cannot place an UART and an SPI module into a CY8C24894 chip. Try it.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby Mipo01 » Mon Nov 11, 2013 8:41 am

So far it is implemented like this:
SPI.png
CY8C24894

And it is working but only with direction from SPI to RS485 and USB, someone is implemented it and now I am doing kind of reverse engineering :idea: code is little bit mess, though... and it is my first time I am working with PSoC.
Mipo01
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 16
Joined: Wed Oct 30, 2013 5:41 am

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby bobmarlowe » Mon Nov 11, 2013 10:44 am

Yes, when adding a TX8SW-module you can have everything you want. The device has 2k Ram, buffering data is your job. TX8SW is a bit difficult to handle, it disables interrupts during transfers, so listening to USB, SPI or RX will cease during that time.

Can you get hands on an ICE-Cube (In circuit emulator)?

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby Mipo01 » Mon Nov 11, 2013 12:04 pm

Good to know that I can get it done :-)
Yes Bob, I saw that on the shelf. Transparent plastic box.
Does it help me to get the job done?

Thank you
I am going to continue with development and I will keep the thread updated :-P hopefully with finished solution soon :P
Mipo01
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 16
Joined: Wed Oct 30, 2013 5:41 am

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby bobmarlowe » Mon Nov 11, 2013 2:02 pm

ICE-Cube will definetively help you to get your project working, it separates the boys from the men :mrgreen: . The advantage are the debug capabilities as breakpoints, variable inspection and even a trace buffer.
Check if you have got a probe for your chip.
If not, you will have a probe for a CY8C29466-pxi (28-pin DIL)then you ought to get a PSoc 1 development kit 3210. Then you can start your project on that kit and clone it later into your target device.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby Mipo01 » Tue Nov 12, 2013 1:09 am

We have this dev kit:
http://www.cypress.com/?rID=14327
But board with current project is custom made. I have only ISSP connector available:
ISSP.png
ISSP Scheme

Can I use ICE-Cube with this connector?
Mipo01
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 16
Joined: Wed Oct 30, 2013 5:41 am

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby bobmarlowe » Tue Nov 12, 2013 7:57 am

The ICE-Cube has got a POD which replaces your target chip(!!) in your PCB, it does NOT fit to the ISSP-interface used for programming, here a Miniprog or a Miniprog3 can be connected to.
Since the ICE always comes with a POD for a CY8C29466-PXI (Check if you have got that POD), I suggested you to use a 3210Kit ($40) to build a proof-of-concept with. These debug-capabilities will save you weeks of hard work!


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby Mipo01 » Wed Nov 13, 2013 1:57 am

Now I understand :idea:
I guess this is everything I need:
Debug kit.jpg
Kit

Maybe MiniEvaluatin board is not enough due to lack of pins outputs but in general I can start with this :)
Am I right?
Mipo01
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 16
Joined: Wed Oct 30, 2013 5:41 am

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby bobmarlowe » Wed Nov 13, 2013 7:19 am

Yes, that looks pretty good! :D Try to get it to work as shown in the manual, the mini-eval board can be powered by the ICE-Cube, so checking is easy: just upload an LED-blinking project and see if you get a lightshow.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby Mipo01 » Fri Jan 10, 2014 1:25 am

I just want to let you know I finished the code in December, I removed some bugs and now is working as it should.

Thank you for help ;-)
Mipo01
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 16
Joined: Wed Oct 30, 2013 5:41 am

Re: USB RS485 SPI hub (cy8c24894-24ltxi)

Postby bobmarlowe » Fri Jan 10, 2014 4:39 am

Congratulations to get it to work and thank you for your feedback!


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany


Return to “%s” PSoC1 General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest