CY8C24x94, Artaflex S board, and WirelessUSB LP

Discussion of the PSoC CY8C24x94 and other PSoC like USB parts from Cypress should be discussed here. This forum is limited to the discussion of USB portion of those parts. Other forums should still be used to discuss the non USB features of these parts.

Moderator: ericb

CY8C24x94, Artaflex S board, and WirelessUSB LP

Postby dougm007 » Thu Nov 12, 2009 5:47 pm

I have successfully interfaced the Artaflex AWP24S radio to CY8C21434 and CY8C29666 PSoC 1 devices using the WirlessUSB LP v1.4 driver code. I cloned these projects to use a CY8C24894 PSoC 1 and extremely carefully checked all of the interconnections, which came across flawlessly in the cloning and the software I'm using is identical for all cases.

I can see transmit and receive activity on the SPIM MOSI, MISO, CLK, pins and the radio chip select (SS) pin and, in fact, I can continuously transmit data and verify it. However, I get transmit errors and I am not receiving transmissions correctly at all.

Any clues as to what the problem is?

Thanks,
Doug
dougm007
Cheese Cube
Cheese Cube
 
Posts: 31
Joined: Thu Sep 10, 2009 7:28 am

Re: CY8C24x94, Artaflex S board, and WirelessUSB LP

Postby graaja » Thu Nov 12, 2009 8:00 pm

Is the SPI clock within the limits of the radio transceiver? Check out the Radio's data sheet for the maximum clock speed on the SPI lines and set the clock to the SPIM accordingly. The output bit rate of the SPIM user module is 1/2 of the clock input. So, if you have a clock of 8MHz to the SPIM, the SCLK frequency would be 4MHz.
User avatar
graaja
PSoC Master
PSoC Master
 
Posts: 3084
Joined: Thu Dec 18, 2003 4:35 pm
Website: http://www.planetpsoc.com
Location: India

Re: CY8C24x94, Artaflex S board, and WirelessUSB LP

Postby dougm007 » Sun Nov 15, 2009 3:31 pm

Ganesh,

I appreciate your help. I have used a 2MHz clock to the SPIM SCLK input, where the radio can accept up to about 4.2MHz. This radio board works with two different PSoCs, so it doesn't appear to be a problem with the radio (and I've tried other working radio boards). If I put the PSoC in a loop transmitting only, I receive the correct data using a separate receiver, but get transmit errors (a red blinking LED from the code attached). If I put the PSoC in a loop and "assume" it has received something (RadioStartReceive(); delay; RadioGetReceiveState();, without checking return values) I will occasionally get a transmission echoing the character that I am transmitting to this radio. So something seems very marginal. I am including test code below, which works on two other PSoCs, in case anyone has any suggestions.

Thanks,
Doug

main.c
(5.81 KiB) Downloaded 285 times
dougm007
Cheese Cube
Cheese Cube
 
Posts: 31
Joined: Thu Sep 10, 2009 7:28 am

Re: CY8C24x94, Artaflex S board, and WirelessUSB LP

Postby dougm007 » Tue Nov 17, 2009 9:08 am

Ganesh and others,

Thanks for your help with this problem. The problem turned out to be with the CY8C24894 quadrant of the PSoC Express Evaluation Kit. One or more of the inline resistors to the Artaflex AWP24S Radio header for IRQ (R77), MOSI(R79), SCLK(R80), MISO(R81), and SS(R82), are too large in resistance value, probably slowing down the timing to the radio. There is a relatively long trace path from the PSoC to the header on this quadrant of the board. At Cypress' suggestion, I just shorted these resistors (which are, literally, about the size of an amoeba) and that got the radio working with the code I had attached previously. I would guess the problem was only with SCLK and/or MOSI and/or MISO, but I spent way too much time getting a working radio to mess with this any more. I suspect a lower resistance han the 5.6K Cypress used would work.

I hope this spares someone else some grief!

Regards,
Doug Michalsky
dougm007
Cheese Cube
Cheese Cube
 
Posts: 31
Joined: Thu Sep 10, 2009 7:28 am

Re: CY8C24x94, Artaflex S board, and WirelessUSB LP

Postby gregelectric » Tue Apr 27, 2010 3:48 pm

The instructions provided in the LP Radio Driver Documentation v1.4 are not very clear (to me).
I am not clear on how to include the driver files into a project.
Where are they added, how should they be added?

The following is code executes, however the reset pin never goes high and no response on MOSI, then gets stuck:

Code: Select all
    // Initialize SPIM block and validate POR of the radio
    SPIM_Radio_Start(SPIM_Radio_SPIM_MODE_0 | SPIM_Radio_SPIM_MSB_FIRST);
    LP_nSS_Data_ADDR |= LP_nSS_MASK;                        // Deassert the LP_nSS pin
    while( !(RadioGetChannel() == 0) ) RadioSetChannel(0);  // Wait 'til RST pin voltage < VIL

    RadioInit(0x04, 0x0F);        // Try 8DR: DATMODE_8DR = 0x08. With 32-chip, gives 250kbps raw.
                                  // Try with END_STATE_IDLE = 0x04 and ACK_EN = 0x80
    Delay = 255;
    while(Delay){}

    RadioSetPtr((BYTE *)&AppBuf);     //
    RadioSetLength(sizeof(AppBuf));   //
    RadioSetFrameConfig(0xEE);        // FRAME + SOPTH
    RadioSetThreshold64(0x0E);        //
    RadioSetThreshold32(5);           //
    RadioSetChannel(0);               //
    RadioSetSopPnCode(4);             // Change the PN Code for Start of Packet (SOP)
    RadioWrite(0x0C,0x80);            // XOUT=BitSerial
    RadioForceState(0);               // Set END_STATE_SLEEP & Force transition now
    RadioWrite(0x0B,0x20);            // Disable PMU

    while(1)                            // cycle the puck here
    {
        AppBuf[0] = 0;
        bSuccessful = FALSE;
        RadioStartReceive();    // (1st Receive step: "start" receive.)
        while(! (RxState = RadioGetReceiveState() & RADIO_COMPLETE) ); // (2nd Receive step: check status of receive request.)


... gets stuck here at while loop
gregelectric
Cheese Cube
Cheese Cube
 
Posts: 35
Joined: Fri Sep 04, 2009 8:25 pm

Re: CY8C24x94, Artaflex S board, and WirelessUSB LP

Postby HCRothschild » Sun May 02, 2010 6:43 pm

Thanks for sharing this useful information.
HCRothschild
Newbie
Newbie
 
Posts: 1
Joined: Sun May 02, 2010 6:39 pm

Re: CY8C24x94, Artaflex S board, and WirelessUSB LP

Postby dougm007 » Thu May 13, 2010 8:12 am

Greg,

Just to tie up the loose end to this thread:

I think you have some of your answers, from our correspondence, but for the sake of others:

1) The radio reset pin is active HIGH, so I normally see a capacitor tied to this pin and to VCC, so when power is applied, this input is initially HIGH and the capacitor charges through an internal 10k resistor on this pin, bringing this input LOW.

2) Regarding how to load the WirelessUSB Lp driver code, just put all of the driver files (lpIrqMacros.inc, lpNonstreaming.asm, lpRadio.asm, lpRadio.h, lpRadio.inc, lpRegs.h, lpRegs.inc, lpSpi.asm, lpStreaming.asm) under your main project folder, along with your main.c and other files. I'm assuming you are using the PSoC Designer environment. If so, from Workspace Explorer, "add" these files to your project by right-clicking on the main project folder that has sub-folders "Source Files", "Header files", etc., and follow the procedure for adding files. The environment will put them in the correct folders based on the file type. NOTE that you can only choose one of the files "lpNonstreaming.asm" or "lpStreaming.asm". From what I understand of your application, you need less than 16-byte packets, so choose "lpNonstreaming.asm" just to simplify life a bit. NOTE: You probably have done all of this already, since you were able to compile and run your program to some degree.

3) Finally, regarding your question of why you are hung at the "while()" loop (I assume you are referring to the RadioGetReceiveState() line): put a line of code in this loop to blink an LED, if you have one in your circuit, to know this is where you are stuck. If this is the case, then the radio likely really is waiting for a valid reception. So make sure you are really transmitting data that it should recognize, making sure both transmitting and receiving radios are set up the same (same PN codes, channel #, data mode, data code length, etc).

Hope this helps.

Regards,
Doug
dougm007
Cheese Cube
Cheese Cube
 
Posts: 31
Joined: Thu Sep 10, 2009 7:28 am

Re: CY8C24x94, Artaflex S board, and WirelessUSB LP

Postby christopher0026 » Tue Jan 22, 2013 10:52 pm

hi , i am new to use wireless on psoc.
what is the difference between wirelessUSB and cyfi ???
i want to design point to point connection between my robot and remote....can someone suggest me which one i should use ...either cyfi or wireless usb ?
I have psoc 1/3/5 all firsttouch starter kit .i also have artaflex24s usb dongles ..
waiting for reply soon as my submission date is very near.....
christopher0026
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Mon Aug 13, 2012 5:31 am


Return to “%s” USB

Who is online

Users browsing this forum: No registered users and 1 guest