add a UART port

Hello ,
i want to know is it possible to add virtual port used two GPIO for tx and rx uart in the wavecom q2687 , if it is possible there is somone that you have an example please or an idea !

Thank you .

Regards

no, can’t be done.

what you can do is connect one using spi or i2c

although, you really need more than two(three if you cont usb) serial ports?

Thak you for your answer
I need two UART in my program but i want to keep UART1 for debug.

Regards.

It is possible to use a UART for both debug and application comms - see: viewtopic.php?f=53&t=2509&p=11123&hilit=external+com#p11123

Thank you but it isn’t clear for me , you can give me some details .

Regads

Have you read the description in the Tools Manual?

Which part(s), precisely, is/are not clear?

I successfully managed to use GPIO as software UART, but the highest possible baudrate is 1200bps. Any higher baud rate is not possilbe right now.

You can help me to do this !

Wouldn’t adding an SPI- or I2C-connected UART be simpler?!

i want to use the i2c and spi in the next version of my software but if there isn’t a solution i have no choice

I2C is certainly a bus connection, and SPI can be - so the fact the you put one device on doesn’t (necessarily) preclude adding other devices…

Have you actually looked carefully at using the TMT+TE facilities yet?

That way, you wouldn’t require any extra devices at all! :smiley:

Thank you awneil for your help , i will use th TMT+TE .

I2C actually doesn’t work. So it is not a good idea to recommend it. As far as I know SPI also has a bunch of bugs. And since Q2686 has only 2 UART it is useless without external processor in somewhat complex applications.

Hiya,

Both I2C (@ 100kHz) and SPI (@2MHz) are working fine for me on the Q2686, OS R7.1 - R7.3.

Both SPI & I2C are running as Masters.

The API is a little tricky to get your head around, but otherwise, no problems.

ciao, Dave

How many other modules on the market have >2 UARTs?

I don’t know which modules have more than 2 UARTs but I know that every module on market has at least 1 UART and much lower price. If used with external processor cost and extendability of the final device could be reduced dramatically.

My I2C code freezes after 10 minutes of using. The only difference is that on R7 it does not freeze the entire application - multitasking in action. :slight_smile:

I’d love to see your I2C code to compare with. Probably wavecom’s I2C just does not work properly with clock stretching mode and the overall result depends on slave. Also I have not seen succesfull using of multiple slaves with wavecom module. Have you tried it?

With SPI I’ve heard rumors about CS problems. But I haven’t tried it.

so did my q2686 in I2C-comm
problems arose indeed with clock-stretching, wrong pullup-resistor values and also with disturbences in the 3v3 pullup voltage. (is still kills the whole processor even on R7.x)

i’m currently using 2 nxp led-dimmers (on th I2C bus).

i’ve had no problems with SPI so far.

Hiya,

I’ve only got one I2C slave - a Maxim/Dallas DS2482-100 I2C to One-Wire bridge. Haven’t tried clock streching as I didn’t need to. However, I have my I2C bus running through a bi-directional level shifter (the One-Wire stuff runs off 5V, and won’t quite run down to 2.8V. Sigh!) - so Q26 side of the bus is pulled up to the Q26 supplied 2V8, and the other side of the bus is pulled up (quite hard) to 5V. This may be why I haven’t seen the problems that Madouc is referring to.

Here’s the I2C bus set-up code I use:

const adl_busI2CSettings_t DS2482Config = 
{
    0x18,                               // device address = 0x18
    ADL_BUS_I2C_CLK_STD,                // standard bus speed (100kHz)
    ADL_BUS_I2C_ADDR_7_BITS,            // 7 bit address mode
    ADL_BUS_I2C_MASTER_MODE             // Q2686 is Bus Master
};

const adl_busAccess_t DS2482BusAccess = 
{
    0,                                  // address = 0
    0                                   // no op-code
};

/***************************************************************************/
/*  Globals                                                              */
/***************************************************************************/

// bus handles
s32 DS2482I2CHandle;

// data buffers
u8 DS2482WriteBuffer[DS2482_WRITE_SIZE], DS2482ReadBuffer[DS2482_READ_SIZE];

/***************************************************************************/
/*  Functions                                                              */
/***************************************************************************/


bool DS2482_busSubscribe()
{
    u32 DataSize = 8;
    
    DS2482I2CHandle = adl_busSubscribe( ADL_BUS_ID_I2C, 1, (adl_busI2CSettings_t *)&DS2482Config );
    
    TRACE (( DS2482_TRACE_BUS , "DS2482_busSubscribe(): DS2482I2CHandle = %d", DS2482I2CHandle ));
    
    adl_busIOCtl (DS2482I2CHandle, ADL_BUS_CMD_SET_DATA_SIZE, &DataSize);

    wm_memset( DS2482WriteBuffer, DS2482_WRITE_SIZE, 0);
    wm_memset( DS2482ReadBuffer, DS2482_READ_SIZE, 0);
    
    return TRUE;
}

extern bool DS2482_busUnSubscribe()
{

    TRACE (( DS2482_TRACE_BUS , "DS2482_busSubscribe()" ));
    adl_busUnsubscribe(DS2482I2CHandle);

    return TRUE;
}

My previous experiences with I2C on other micros was not all that great - had lots of problems with choice of pull-ups and track layout - especially with multiple devices, so tended to steer away from it where I could.

I had grief using the ADL_BUS_SPI_ADDR_CS_HARD option and ended up using the ADL_BUS_SPI_ADDR_CS_GPIO option for Chip Select. I then used the GPIO that corresponded to the CS pin on the Q26. Again, I only have a single device on the bus, and aren’t doing any mode or speed switching.

Getting all the bus stuff running was not all that straightforward - especially decoding what Wavecom mean when the API is talking about op-codes and addressing in the adl_busAccess_t structure. I spent a lot of time experimenting by sending data down the bus and staring at CRO screen captures to see what actually was happening.

ciao, Dave