Quantcast
Channel: Forums - Recent Threads
Viewing all 262198 articles
Browse latest View live

C6657 DDR3 DQ vs DQS timing

$
0
0

Thank you for all your support.

During debugging unstable DDR3 memory access, I found out "unexpected write access timing" as attached. It seems that DQ and DQS timing is shifted by 45 degree, and I believe this should be right in the center. I was wondering if any of you could advise me how to fix this. The configuration is below. I appreciate this.

DSP: TMS320C6657CZH25

memory, Micron: MT41J128M16HA-125

8 banks open for interleaving
RZQ/2
RZQ/2
RZQ/7
CWL = 8
32-bit bus width
CAS = 11
14 row bits
8 bank SDRAM
Use DCE0# for all SDRAM accesses
1024-word page


Problems getting SPI1 to work on AM3359

$
0
0

Hi

I believe that I've looked through all relevant posts already as well as read relevant chapters of the TRM, but I'm stuck.

I'm using the IDK base board as a starting point to start some software development while waiting for the guys to finish our own hardware. I've taken the daughter board off as I needed access to pins more than I needed the stuff on this board, at least for now.

I'm trying to get SPI1 working as a master transmitter to begin with.

I'm stuck working in IAR EWARM with board support files supplied by Micro Digital for their smx RTOS, so I cannot reference starterware functions and definitions.

My SPI1_Init function sets up clocks and pins. 

Resets the SPI1 module and configures it. All this can be seen below

#define MODULEMODE (0x03u)
#define MODULEMODE_ENABLE (0x02u)
#define MODULECTRL (0x03u)
#define MODULECTRL_WKUP (0x02u)
void SPI1_ModuleClkConfig(void)
{
/* Configuring L4 Interface Clocks. */
/* Writing to CLKTRCTRL field of CM_PER_L3S_CLKSTCTRL register. */
CM_PER_L3S_CLKSTCTRL = MODULECTRL_WKUP;
/*Waiting for CLKTRCTRL field to reflect the written value. */
while((CM_PER_L3S_CLKSTCTRL & MODULECTRL) != MODULECTRL_WKUP);

/* Writing to CLKTRCTRL field of CM_PER_L3_CLKSTCTRL register. */
CM_PER_L3_CLKSTCTRL = MODULECTRL_WKUP;
/* Waiting for CLKTRCTRL field to reflect the written value. */
while((CM_PER_L3_CLKSTCTRL & MODULECTRL) != MODULECTRL_WKUP);

/* Writing to MODULEMODE field of CM_PER_L3_INSTR_CLKCTRL register. */
CM_PER_L3_INSTR_CLKCTRL = MODULEMODE_ENABLE;
/* Waiting for MODULEMODE field to reflect the written value. */
while((CM_PER_L3_INSTR_CLKCTRL & MODULEMODE) != MODULEMODE_ENABLE);

/* Writing to MODULEMODE field of CM_PER_L3_CLKCTRL register. */
CM_PER_L3_CLKCTRL = MODULEMODE_ENABLE;
/* Waiting for MODULEMODE field to reflect the written value. */
while((CM_PER_L3_CLKCTRL & MODULEMODE) != MODULEMODE_ENABLE);

/* Writing to CLKTRCTRL field of CM_PER_OCPWP_L3_CLKSTCTRL register. */
CM_PER_OCPWP_L3_CLKSTCTRL = MODULECTRL_WKUP;
/*Waiting for CLKTRCTRL field to reflect the written value. */
while((CM_PER_OCPWP_L3_CLKSTCTRL & MODULECTRL) != MODULECTRL_WKUP);

CM_PER_L4LS_CLKSTCTRL = MODULECTRL_WKUP;
while((CM_PER_L4LS_CLKSTCTRL & MODULECTRL) != MODULECTRL_WKUP);

CM_PER_L4LS_CLKCTRL = MODULEMODE_ENABLE;
while((CM_PER_L4LS_CLKCTRL & MODULEMODE) != MODULEMODE_ENABLE);

CM_PER_SPI1_CLKCTRL &= ~MODULEMODE;
CM_PER_SPI1_CLKCTRL |= MODULEMODE_ENABLE;
while((CM_PER_SPI1_CLKCTRL & MODULEMODE) != MODULEMODE_ENABLE);

/* Checking fields for necessary values. */
// wait until all wakeups are done and clks are active
while(!(CM_PER_L3S_CLKSTCTRL & 0x08u));
while(!(CM_PER_L3_CLKSTCTRL & 0x10u));
while(!(CM_PER_OCPWP_L3_CLKSTCTRL & (0x10u | 0x20u)));
while(!(CM_PER_L4LS_CLKSTCTRL & (0x100u | 0x02000000u)));
}

void SPI1_ModulePinConfig(void)
{
/* Set pins multiplexing for SPI1 */
//SPICLK: receiver enabled, pullup selected and enabled, mode 3
CONF_MCASP0_ACLKX = 0x33;
//SPID0 MISO: receiver enabled, pullup selected and enabled, mode 3
CONF_MCASP0_FSX = 0x33;
//SPID1 MOSI: receiver enabled, pullup selected and enabled, mode 3
CONF_MCASP0_AXR0 = 0x33;
//SPICS0: receiver enabled, pullup selected and enabled, mode 2
CONF_RMII1_REFCLK = 0x32;
//SPICS1: receiver enabled, pullup selected and enabled, mode 2
CONF_ECAP0_IN_PWM0_OUT = 0x32;
}

/**
* \brief This API will reset the McSPI peripheral.
*
*
* \return none.
**/
#define MCSPI_SYSCONFIG_SOFTRESET (0x02u)
#define MCSPI_SYSSTATUS_RESETDONE_COMPLETED (0x01u)

void SPI1_Reset(void)
{
/* Set the SOFTRESET field of MCSPI_SYSCONFIG register. */
MCSPI1_SYSCONFIG |= MCSPI_SYSCONFIG_SOFTRESET;

/* Stay in the loop until reset is done. */
while(!(MCSPI_SYSSTATUS_RESETDONE_COMPLETED & MCSPI1_SYSSTATUS));
}


void SPI1_Init(void){

//set up clk
SPI1_ModuleClkConfig();
//set up pins
SPI1_ModulePinConfig();
//reset
SPI1_Reset();

//set to master single channel mode
MCSPI1_MODULCTRL = 0x03;

//see pp 4593 in SPRUH73i
MCSPI1_CH0CONF_bit.PHA = 0;
MCSPI1_CH0CONF_bit.POL = 0;
MCSPI1_CH0CONF_bit.CLKD = 0xF;
MCSPI1_CH0CONF_bit.EPOL = 1;
MCSPI1_CH0CONF_bit.WL = 7;
MCSPI1_CH0CONF_bit.TRM = 2; //2 Tx only, 0 Tx and Rx
MCSPI1_CH0CONF_bit.DMAW = 0;//tx dma
MCSPI1_CH0CONF_bit.DMAR = 0;
MCSPI1_CH0CONF_bit.DPE0 = 1;
MCSPI1_CH0CONF_bit.DPE1 = 0;
MCSPI1_CH0CONF_bit.IS = 0;
MCSPI1_CH0CONF_bit.TURBO = 1;
MCSPI1_CH0CONF_bit.FORCE = 0;
MCSPI1_CH0CONF_bit.SPIENSLV = 0;
MCSPI1_CH0CONF_bit.SBE = 0;
MCSPI1_CH0CONF_bit.SBPOL = 0;
MCSPI1_CH0CONF_bit.TCS = 0;
MCSPI1_CH0CONF_bit.FFEW = 1;
MCSPI1_CH0CONF_bit.FFER = 0;
MCSPI1_CH0CONF_bit.CLKG = 0;

//set FIFO Level
MCSPI1_XFERLEVEL = 31; //IRQ when there's this much room (n+1) in FIFO

//clear all pending IRQs
MCSPI1_IRQSTATUS = 0x2777F;
}

From my task I enable TX IRQ and enables the SPI module

void SPI1_EnableIRQ(void){
/* Hook SPI1 ISR to vector and unmask it. */
sb_IRQVectSet(INT_MCSPI1INT, SPI1_ISR);
sb_IRQConfig(INT_MCSPI1INT);
sb_IRQUnmask(INT_MCSPI1INT);

MCSPI1_IRQENABLE = 0x0001;//NIJ enable TX0_EMPTY_ENABLE
MCSPI1_CH0CTRL_bit.EN = 1;// enable channel
}

This brings me to my ISR which fills in data in the FIFO

void SPI1_ISR_FPGA_config(void)
{
static uint32_t counter = 0;
counter++;
//smx_RTC_ISR_START(); //profiling. remember smx_RTC_ISR_END(); if uncommented Should only be instrumented if necessary as it adds quite a bit of code to the ISR.
smx_EVB_LOG_ISR(Spi1ISRH); //event buffer log.
sb_IRQClear(INT_MCSPI1INT);



while( (!MCSPI1_CH0STAT_bit.TXFFF) & (Spi1TxArrayindex<Spi1TxArrayLength) ){
MCSPI1_TX0 = *(Spi1TxArrayPtr+Spi1TxArrayindex++);
}
if(Spi1TxArrayindex == Spi1TxArrayLength){
MCSPI1_IRQENABLE = 0x0;//disable interrupts
}
MCSPI1_IRQSTATUS = 0x01;//clear irq


sb_IRQEnd(INT_MCSPI1INT);
smx_EVB_LOG_ISR_RET(Spi1ISRH);
//smx_RTC_ISR_END();//profiling. Must be used with smx_RTC_ISR_START();

}

When I execute the code I get to the interrupt and it fulls up the FIFO, but I only get there once. the stuff never gets transmitted.

When I look at the signals on a logic analyzer I see no movement on any of the lines.

If I change polarity I do see the clk stuck high or low depending on setting, as expected.

This leads me to believe that the pin mux part is ok.

In a debugger I can see all my registers and read them so I believe the relevant modules are powered and clocked.

I'm sure this is something simple I just missed, but I can't seem to find out what.

If any more information is desired or any register values should be posted to help me please let me know

Any pointers is greatly appreciated.

 

bootloader does not start if application erased

$
0
0

Hi, 

I tried boot_serial example. it can successfully update firmware using UART.

I use ICDI (Eval Board) mode to download boot_serial.bin file at the flash location 0x00.

then, I also use ICDI (Eval Board) mode to download myApplication.bin at the flash location 0x1800.

this is fine. it works. I can jump to bootloader call within myApplication. and it erases my Application and programming a new version using Serial (UART) mode in LM Flash.

However, I encountered a problem. I only ICDI (Eval Board) mode to download boot_serial.bin. at location 0x00 ONLY. and then I tried to use LM FLash Programmer Serial (UART) (NOT ICDI (Eval Board) mode) to download myApplication.bin at 0x1800. apparently, it cannot communication with the device. it seems the UART is not working.

regarding to the theory. when the device power up. it will call CheckForceUpdate function. this function will check the APP_START_ADDRESS, if APP_START_ADDRESS is 0xFFFFFFFF, then it will enter bootloader. this means it suppose to enter bootloader if I only program boot_serial.bin file. 

Am I right? 

BTW, I modified boot_serial program. the original boot_serial program using UART0. I modified using UART2 and is half duplex. 

I used JTAG debug the boot_serial code. I found the program is program is stay at UARTReceive() function. it always waiting for. 

any ideas? 

Thanks in advance

ti.sysbios.family.arm.lm4.Timer: bad inline assembly under gcc

$
0
0

SYSBIOS: 6_35_03_47 and 6_35_04_50

ti/sysbios/family/arm/lm4/Timer.c:968

Bool Timer_masterDisable(Void)
{
    /* read PRIMASK bit to R0 and call CPSID to disable interrupts */
    asm("    mrs     r0, PRIMASK\n"
        "    cpsid   i\n"
        "    bx      lr\n");
    /*
     * The following return statement keeps the compiler from complaining
     * about a missing return value.  The "bx lr" above does the actual return
     * and the below statement is not executed.
     */
    return (0);
}

compiles to incorrect code (return before stack restore) that leads to an exception on TM4C123GXL:

(gdb) disas 0xaefe
Dump of assembler code for function ti_sysbios_family_arm_lm4_Timer_masterDisable__I:
   0x0000aef4 <+0>:     push    {r7}
   0x0000aef6 <+2>:     add     r7, sp, #0
   0x0000aef8 <+4>:     mrs     r0, PRIMASK
   0x0000aefc <+8>:     cpsid   i
   0x0000aefe <+10>:    bx      lr
   0x0000af00 <+12>:    mov.w   r3, #0
   0x0000af04 <+16>:    mov     r0, r3
   0x0000af06 <+18>:    mov     sp, r7
   0x0000af08 <+20>:    pop     {r7}
   0x0000af0a <+22>:    bx      lr
End of assembler dump.

One possible fix:

Bool Timer_masterDisable(Void)
{
    int r;
    /* read PRIMASK bit and call CPSID to disable interrupts */
    asm("    mrs     %[r], PRIMASK\n"
        "    cpsid   i\n"
    : [r] "=&r" (r)
    :
    );
    return r;
}

gcc:

$ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/bin/../lib/gcc/arm-none-eabi/4.7.4/lto-wrapper
Target: arm-none-eabi
Configured with: /build/buildd/gcc-arm-none-eabi-4-7-2013q3/src/gcc/configure --target=arm-none-eabi --prefix=/build/buildd/gcc-arm-none-eabi-4-7-2013q3/install-native --libexecdir=/build/buildd/gcc-arm-none-eabi-4-7-2013q3/install-native/lib --infodir=/build/buildd/gcc-arm-none-eabi-4-7-2013q3/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/build/buildd/gcc-arm-none-eabi-4-7-2013q3/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/build/buildd/gcc-arm-none-eabi-4-7-2013q3/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/build/buildd/gcc-arm-none-eabi-4-7-2013q3/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/build/buildd/gcc-arm-none-eabi-4-7-2013q3/install-native/arm-none-eabi --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r
Thread model: single
gcc version 4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601] (GNU Tools for ARM Embedded Processors) 

in msp430 microprocessor, how to save data to USB stick or other outside storage

$
0
0

I use MSP430FG4619 in my current design, I want to save data to USB stick or other outside storage, such as SD card, how to do it? also I find MSP430f6635 has USB module, but looks like it is not for USB stick, it is for connection with computer to commnuicate, like RS232 function, is it correct?

XDS100v2 Performance and VMWare

$
0
0

Hello,

I saw some posts and the Wiki entry about the performance of the XDS100v2 emulator and Linux in the Virtual Machine.

However, I didn't found anything about the combination of Windows XP as Host and in the VM.
One of our customers reportet that he has very low performance with the combination and CCS v4.
I also verified this on my machine and had a even worse performance in this configuration.

Is this issue also a known one?

Is there any workaround available?

 

Best Regards,

Christian

Some functions explained

$
0
0

Hi Chris,

The ID process works great. your recommendations worked.Now, since my motor reaches only half of the rated speed, then starts making strange "squeaking" noises, I would like to understand a couple of things.

1. While running in CTRL_runOnLine_User , I see that the reference for Id is the following:

          refValue = TRAJ_getIntValue(obj->trajHandle_Id) + CTRL_getId_ref_pu(handle);

 can you please explain what does the trajectory is doing there and how it is related to controlling the Id current ? I saw that you're running some trajectory at the end of the ISR, in CTRL_setup.

2. Where do you run the trajectory for the speed (I tired searching for trajHandle_spd , but seems no one is updating it, only reading from it...)

3. What are you compensating for in CTRL_angleDelayComp ? why are you considering the sign in that function, if the angle is between 0..1 ?

4. I tried running the control with floating point enabled. I started form lab 2d, and actually observed different behavior than in lab 2c. In the transition between rated-flux state and Ls, there were some speed oscillations, which did not exist in lab 2c...

5. Trying for investigate further on the floating point, I saw that you're using optimization level 2. This thing I don't really like, since I'm not a compiler expert, and I expect my code to run as I write it... Changing the optimization to "none", suddenly I realized that the code is running much much slower, about half the speed (instead of about 20us, it takes about 45  us for the ISR), which is a lot ! I've tested this with a scope and GPIO toggling.

However, the speed oscillations in the ID process stopped !

Could it be that the optimization does something to floating point code ?

How to incorporate the CC2541 SPI communication code into the CC2540 Keyfob demo project?

$
0
0

I am trying to use the CC2540 Keyfob to read data from a data converter through SPI communication.

I have read about two SPI communication projects: the Serial_BLE_Bridge and the CC2541_43_44_45_Peripherals_Software_Examples.
How can I incorporate one of them to the original CC2540 Keyfobdemo project?

Thanks for any instructions.


Easiest way to hook up ADC to PC for continuous data streaming?

$
0
0

I am working on a multi-channel data acquisition system, and I would like to utilize the TI ADS1274 series ADCs. I have played a bit with the EVM and EVM-PDK modules, but their big disadvantage is that they acquire data for 1 second, and then take 30 seconds to nibble the acquired data back to the PC using USB 1.0 speeds. That's basically useless. What I need is continuous acquisition and streaming.

So my question is, where should I start? I am willing to learn on my own, but I would appreciate being pointed in the right direction. For example, is there an easy and inexpensive way to take the SPI out data from the ADC, and to have it continuously streamed (with minimal or no buffering) to a Labview application running on a PC?

I think there are some SPI -> USB -> PC solutions. This kind of setup might work for me. Is there a particular recommendation for a good and simple implementation?

Also, a more interesting alternative to me would be some SPI -> Ethernet -> PC solution. Again, is there a recommendation for a simple and good implementation?

I wish it would be easier to interface the ADC / DAC components directly to a PC. Maybe in the future TI could implement a minimal TCP/IP stack and ethernet interface right on the ADC silicon? Hint, hint ...

DK-LM3S9D96: external flash usage.

$
0
0

Hi,

I'm trying to use the external flash on the development board but I'm unable to use it.

When I call:

int
main(void)
{
    unsigned long ulUser0, ulUser1;

    printf("\nInitialising all the stuff: \n");

    //
    // Set the system clock to run at 50MHz from the PLL.
    //
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_INT);

    //ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); // with extern crystal //SYSCTL_OSC_INT internal// SYSCTL_OSC_MAIN external
    printf("Board running on speed: %u MHz\n", SysCtlClockGet() / 1000000);

    //
    // Set the pinout appropriately for this board.
    //
    PinoutSet();

    printf("Located flash size: %u\n", ExtFlashChipSizeGet());
}

It returns 1, which is the default return value.

Am I missing some call of some kind?

-- Mathijs

LP29895.0AIM - driving LED for ERROR flag circuit

$
0
0

Hello,

I came up with this circuit for driving a LED on when error pin (pin 7) of LP29895.0 goes low. IC is supplied with +12V

My goal is to do it using only a pair of bjt and some resistors. Circuit attached, may be useful to someone - if it works as intended!! ;).

TINA simulations told me everything is fine. Both bjt are off when pin is high, and on when it goes low.

Real LED , however, is standard red:

http://www.mouser.com/Search/ProductDetail.aspx?R=LH_R974-LP-1virtualkey62510000virtualkey720-LHR974-LP-1

Vf = 1.8V , If = 30 mA. For that, RLED in circuit will need some adjustment.

Please note that I've used a simple resistor divider from +12V to compare with the error pin output, instead of using +5V output, because I want the LED on even if the the IC is damaged - then there would be no voltage at the output. Also, op amp 741C is meant to consider the internal op amp that drives pin 7 of the LP2989. I can't tell how much current it may sink, BTW.

Since I can't test it in real world, would you care to take a look with fresh eyes and check if it should work?

EDIT: I am assuming high output in error pin = supply voltage in pin 4, is that right? Nowhere in datasheet...

Thank you!

(Please visit the site to view this file)

USB Camera with TMS320C6748

$
0
0

Can USB be connected to  TMS320C6748, if yes then any additional hardware or support required for this process?

about the tms320f28069upzt flash error

$
0
0

before this problems,i use the TMX320F28069PZA,and use the xds100v3 & ccs5.3,i can flash the 28069,but i buy 50ps tms320f28069upzt ,and i use it ,but the xds100v3 and 28069 test connect is succeeded.but when i debug,i tell me

C28xx: Flash Programmer: Device is locked or not connected. Operation cancelled.
C28xx: GEL: File: D:\workspace\SXD28069B\F2806x_examples_CCS5_2\Example_28069Flash\Debug\Example_28069Flash.out: Load failed.

and i use same schematic and same xds100v3,and i thins the xds100v3 is ok,and i flash the TMX320F28069PZA's board is ok,but when i flash the  tms320f28069upzt 's board,the console tell me the errors ,and  i can not debug the same program

please tell me the reasons.bucause i have the 50 borads have the same problems,and i must use the TMX320F28069PZA,the reason why my tms320f28069upzt is locked,my supplyer tell me this ic is ti sell him.thanks a lot .i very hury.

i use the board is ,the different is the CPU,one is "TMX320F28069PZA" is ok ,and another is "tms320f28069upzt ",and this have problems.

http://item.taobao.com/item.htm?spm=a1z10.1.w15282846-1069690531.3.n7xhGh&id=17638162778

zcl_incoming reached for zcl command

$
0
0

Hi guys, anybody can help me please. I tried to design a Texas Home Automation simpleSW as a ZED, on my customized SOC. I had a success to connect on a commercial gateway. I got a success to join in a gateway. i see it on a Perytons Protocol Analyzer.  You can see it on a message log below:

During the debug procedure on a IAR 8051 i can see that the join procedure was reached, as you can see it above, but wen the ZCL command On/Off came from the Gateway to ZED (my customized SOC). As you can see below, the "afIncomingMSGPacket_t", on the loop, was reached when the ZED received MgmntPermitJoinReq. But the ZCL_INCOMING MSG never was not reached. Please anybody can help me. 

IAR Debug code:

Below i including a few parameters to help the code analyze:

void zclSampleSw_Init( byte task_id )
{
zclSampleSw_TaskID = task_id;

// Set destination address to indirect
zclSampleSw_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
zclSampleSw_DstAddr.endPoint = 0;
zclSampleSw_DstAddr.addr.shortAddr = 10;

// This app is part of the Home Automation Profile
zclHA_Init( &zclSampleSw_SimpleDesc );

// Register the ZCL General Cluster Library callback functions
zclGeneral_RegisterCmdCallbacks( SAMPLESW_ENDPOINT, &zclSampleSw_CmdCallbacks );

// Register the application's attribute list
zcl_registerAttrList( SAMPLESW_ENDPOINT, SAMPLESW_MAX_ATTRIBUTES, zclSampleSw_Attrs );

// Register the Application to receive the unprocessed Foundation command/response messages
zcl_registerForMsg( zclSampleSw_TaskID );

// Register for all key events - This app will handle all key events
RegisterForKeys( zclSampleSw_TaskID );

// Register for a test endpoint
afRegister( &sampleSw_TestEp );

ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, End_Device_Bind_rsp );
ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, Match_Desc_rsp );
}

/*********************************************************************
* @fn zclSample_event_loop
*
* @brief Event Loop Processor for zclGeneral.
*
* @param none
*
* @return none
*/
uint16 zclSampleSw_event_loop( uint8 task_id, uint16 events )
{
afIncomingMSGPacket_t *MSGpkt;
(void)task_id; // Intentionally unreferenced parameter
HalLedSet ( HAL_LED_2, HAL_LED_MODE_ON ); //ASA
HalLedSet ( HAL_LED_1, HAL_LED_MODE_ON ); //ASA

if ( events & SYS_EVENT_MSG )
{
while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleSw_TaskID )) )
{
switch ( MSGpkt->hdr.event )
{
case ZCL_INCOMING_MSG:
// Incoming ZCL Foundation command/response messages
zclSampleSw_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );
HalLedSet ( HAL_LED_3, HAL_LED_MODE_OFF ); //ASA
break;

case ZDO_CB_MSG:
zclSampleSw_ProcessZDOMsgs( (zdoIncomingMsg_t *)MSGpkt );
HalLedSet ( HAL_LED_3, HAL_LED_MODE_OFF ); //ASA
break;

default:
break;
}

// Release the memory
osal_msg_deallocate( (uint8 *)MSGpkt );
}

// return unprocessed events
return (events ^ SYS_EVENT_MSG);
}

if ( events & SAMPLESW_IDENTIFY_TIMEOUT_EVT )
{
zclSampleSw_IdentifyTime = 10;
zclSampleSw_ProcessIdentifyTimeChange();

return ( events ^ SAMPLESW_IDENTIFY_TIMEOUT_EVT );
}

// Discard unknown events
return 0;
}

void zclSampleSw_Init( byte task_id )
{
zclSampleSw_TaskID = task_id;

// Set destination address to indirect
zclSampleSw_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
zclSampleSw_DstAddr.endPoint = 0;
zclSampleSw_DstAddr.addr.shortAddr = 10;

// This app is part of the Home Automation Profile
zclHA_Init( &zclSampleSw_SimpleDesc );

// Register the ZCL General Cluster Library callback functions
zclGeneral_RegisterCmdCallbacks( SAMPLESW_ENDPOINT, &zclSampleSw_CmdCallbacks );

// Register the application's attribute list
zcl_registerAttrList( SAMPLESW_ENDPOINT, SAMPLESW_MAX_ATTRIBUTES, zclSampleSw_Attrs );

// Register the Application to receive the unprocessed Foundation command/response messages
zcl_registerForMsg( zclSampleSw_TaskID );

// Register for all key events - This app will handle all key events
RegisterForKeys( zclSampleSw_TaskID );

// Register for a test endpoint
afRegister( &sampleSw_TestEp );

ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, End_Device_Bind_rsp );
ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, Match_Desc_rsp );
}

/*********************************************************************
* @fn zclSample_event_loop
*
* @brief Event Loop Processor for zclGeneral.
*
* @param none
*
* @return none
*/
uint16 zclSampleSw_event_loop( uint8 task_id, uint16 events )
{
afIncomingMSGPacket_t *MSGpkt;
(void)task_id; // Intentionally unreferenced parameter
HalLedSet ( HAL_LED_2, HAL_LED_MODE_ON ); //ASA
HalLedSet ( HAL_LED_1, HAL_LED_MODE_ON ); //ASA

if ( events & SYS_EVENT_MSG )
{
while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleSw_TaskID )) )
{
switch ( MSGpkt->hdr.event )
{
case ZCL_INCOMING_MSG:
// Incoming ZCL Foundation command/response messages
zclSampleSw_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );
HalLedSet ( HAL_LED_3, HAL_LED_MODE_OFF ); //ASA
break;

case ZDO_CB_MSG:
zclSampleSw_ProcessZDOMsgs( (zdoIncomingMsg_t *)MSGpkt );
HalLedSet ( HAL_LED_3, HAL_LED_MODE_OFF ); //ASA
break;

default:
break;
}

// Release the memory
osal_msg_deallocate( (uint8 *)MSGpkt );
}

// return unprocessed events
return (events ^ SYS_EVENT_MSG);
}

if ( events & SAMPLESW_IDENTIFY_TIMEOUT_EVT )
{
zclSampleSw_IdentifyTime = 10;
zclSampleSw_ProcessIdentifyTimeChange();

return ( events ^ SAMPLESW_IDENTIFY_TIMEOUT_EVT );
}

// Discard unknown events
return 0;
}

void zclSampleSw_Init( byte task_id )
{
zclSampleSw_TaskID = task_id;

// Set destination address to indirect
zclSampleSw_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
zclSampleSw_DstAddr.endPoint = 0;
zclSampleSw_DstAddr.addr.shortAddr = 10;

// This app is part of the Home Automation Profile
zclHA_Init( &zclSampleSw_SimpleDesc );

// Register the ZCL General Cluster Library callback functions
zclGeneral_RegisterCmdCallbacks( SAMPLESW_ENDPOINT, &zclSampleSw_CmdCallbacks );

// Register the application's attribute list
zcl_registerAttrList( SAMPLESW_ENDPOINT, SAMPLESW_MAX_ATTRIBUTES, zclSampleSw_Attrs );

// Register the Application to receive the unprocessed Foundation command/response messages
zcl_registerForMsg( zclSampleSw_TaskID );

// Register for all key events - This app will handle all key events
RegisterForKeys( zclSampleSw_TaskID );

// Register for a test endpoint
afRegister( &sampleSw_TestEp );

ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, End_Device_Bind_rsp );
ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, Match_Desc_rsp );
}

/*********************************************************************
* @fn zclSample_event_loop
*
* @brief Event Loop Processor for zclGeneral.
*
* @param none
*
* @return none
*/
uint16 zclSampleSw_event_loop( uint8 task_id, uint16 events )
{
afIncomingMSGPacket_t *MSGpkt;
(void)task_id; // Intentionally unreferenced parameter
HalLedSet ( HAL_LED_2, HAL_LED_MODE_ON ); //ASA
HalLedSet ( HAL_LED_1, HAL_LED_MODE_ON ); //ASA

if ( events & SYS_EVENT_MSG )
{
while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleSw_TaskID )) )
{
switch ( MSGpkt->hdr.event )
{
case ZCL_INCOMING_MSG:
// Incoming ZCL Foundation command/response messages
zclSampleSw_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );
HalLedSet ( HAL_LED_3, HAL_LED_MODE_OFF ); //ASA
break;

case ZDO_CB_MSG:
zclSampleSw_ProcessZDOMsgs( (zdoIncomingMsg_t *)MSGpkt );
HalLedSet ( HAL_LED_3, HAL_LED_MODE_OFF ); //ASA
break;

default:
break;
}

// Release the memory
osal_msg_deallocate( (uint8 *)MSGpkt );
}

// return unprocessed events
return (events ^ SYS_EVENT_MSG);
}

if ( events & SAMPLESW_IDENTIFY_TIMEOUT_EVT )
{
zclSampleSw_IdentifyTime = 10;
zclSampleSw_ProcessIdentifyTimeChange();

return ( events ^ SAMPLESW_IDENTIFY_TIMEOUT_EVT );
}

// Discard unknown events
return 0;
}

Thanks a lot.

BR

Alex

Simpliciti with Anaren BoosterPack - Peer to Peer Interrupt Issue

$
0
0

Hello,

I am working on getting the Simpliciti peer-to-peer example application working on my Anaren Air Booster Pack.  With some HW changes, I now have the SPI and GDO pins and LEDs now working like I think they should.  However, I cannot the two boards to link (I have different device addresses for the talker and listener).

In debugging this, it appears the listener board is not seeing any interrupts (set a breakpoint in CCS).  While debugging this, I found what looks like a typo:

In the MRFI_Init() function, the line:

/* enable global interrupts */
BSP_ENABLE_INTERRUPTS();

gets eventually defined in bsp_msp430_defs.h as:

#define __bsp_ENABLE_INTERRUPTS__()       __enable_interrupt()

However, in the intrinsics.h file, the enable interrupt function prototype is defined as:

void           _enable_interrupts(void);

I am not sure how my code compiles without error here.  When I changed the define to match the intrinsics definition, it didn't help my problem.  Any comments or insights would be appreciated.  Thanks,

David


MSP430F2132 internal oscillator jitter

$
0
0

Here is the problem. We need to use a timer to sync to an input signal frequency. We have the timer running at 2Mhz and with 16 bits, we should be able to get down to .5 us resolution.

So we will expect to see a small drift. But this is not what I am seeing. The clock appears to have about 25us of high freq jitter and about 10-15us low freq jitter. So the problem is that we can not pick a value that will keep us in the .5us range. To prove this, we connected an external 8 Mhz xtal. With this xtal, I can find a value that keeps the drift down to 325us per minute, that's a 5us drift per second. This is what we need.

So, first can we get a specification on the internal oscillator jitter?

Also, is there an app note on improving the quality of the oscillator?

Initialization RF430CL330H NFC SPI interface after power-up

$
0
0

Hi,

we want to use SPI for RF430 and in design we have connected the SCMS/CS to a GPIO. This make a problem, that we can not start RF430CL330H in SPI mode. It seems the pull-up in RF430CL330H not possible to pull the GPIO to high. Then we tryed to initialize RF430CL330H by toggling RST during the SCMS/CS is high. But this is still not work.

Does someone have an idea?

PCM1870A-The Max clk can be supply in BCK pin in slave mode

$
0
0

Hi,

for my new design I am using PCM1870A for converting stereo microphone to 16bit TDM.

I config the ADC to be in slave mode.

I provide the signals for the ADC from external CPU (OMAPL138). 

The TDM should be with the following configuration:

-The SCKI (F2 pin) pin should be at 12.288Mz.

-The LRCK (E1 pin) pin should be at 48KHz (FS).

-The BCK (F1 pin)  pin should be at 12.288Mz.

According to the datasheet I am should be able to provide the following signals frequency but I want to confirm my design.

So my question is this:

Can I provide to BCK pin clock with 12.288MHz frequency in Audio TDM format (When the ADC config to be in Slave mode)?

I'd appreciate a quick answer.

Thanks in advance,

Itamar

Issue in real time clock periodic interrupt of SM470R1B1M

$
0
0

(Please visit the site to view this file)

Hello All,

I am working for a project in which i am using SM470R1B1M micro-controller,
I am facing an issue while using the real time timer. after filling up the
registers which appropriate PRELOAD and Counter values, i am not getting
the timer for which i configured.

Here for example i have added my code in attachment in which i am using a
OSCIN as 8MHz & configured SYSCLK of 32 MHz,and as per that if i am writing
PRELOAD as 1 and upcounter value as 1, it should give me interrupt at every
(1/(32MHz)), but i am getting interrupt at every 2,1 us. which is not
matching with my register settings and the clock.

Settings:
Crystal Clock = 8MHz
SYSCLK = 32MHz using PLL
RTIPCTL = 1
RTICMP1 = 1
Comparator 1 enabled.
Here is my code :-

#include <intrinsics.h>
#include <TexasInstruments/iotms470r1b1m.h>
#include <TexasInstruments/tms470r1B1m_bit_definitions.h>



int * ip;

void SM470LedSet(int mask);
void COMP1_irq_handler(void);
void toggle_led(void);

int main(void)
{
  static unsigned char flag = 0;
  unsigned int temp;
  
  // Set up peripheral registers.
  // First disable interrupts.
  __disable_interrupt();
  
  /*ip = led_table;

  // Setup system.
  PCR = CLKDIV_4;                               // ICLK = SYSCLK/4
  PCR |= PENABLE;                               // enable peripherals
  GCR = ZPLL_CLK_DIV_PRE_1;                     // SYSCLK = 8 x fOSC
  REQMASK = (1 << CIM_COMP1);                   // Enable SPI Interrupt mask*/
  
  GCR &= ~ZPLL_MULT4;// SYSCLK = 8x 8MHz = 64MHz
  //--------Divides the clock by 2 so sysclock becomes 64/2 = 32 MHz---//
  GCR |= ZPLL_CLK_DIV_PRE1;
  GCR &= ~ZPLL_CLK_DIV_PRE2;
  GCR &= ~ZPLL_CLK_DIV_PRE3;
  	
  //------------------------------------------------------------------//
  
  PCR &= 0x0000; // ICLK = SYSCLK (32MHz)
  
  PCR |= PENABLE; // Enable peripherals
  
  CLKCNTL |= CLKDIR | CLKSR_SYSCLK;

  // Setup periodic interrupt using RTI with RTICMP1
  RTICNTEN = CNTEN_NOCNT;                       // Stop counting
  RTICNTR = 0x00;                               // clear 21-bits CNTR

  // Setup periodic interrupt timer
  // CMP1 used to generate  interrupt.
  RTIPCTL = 1;                         // preload 11-bits MOD -> 32 MHz/32 = 1MHz
  RTICMP1 = 1;                     // 1 MHz/1000000 = 1 Hz
  RTICNTL = 0x00;                        // clear and disable tap

  // interrupt control, clear CMP1 and enable CMP1 interrupt
  RTICINT = 0x00;
  RTICINT |= CMP1ENA;

  // Start count, CNTR and MOD will count in both USER and SYSTEM mode
  RTICNTEN = CNTEN_UP;
  
  REQMASK |= (1 << CIM_COMP1);
  //FIRQPR |= (1 << CIM_COMP1);
  
  HETDIR |= 0x0100; // HET8 are outputs
  HETDCLR = 0x0100; // Clear HET8 outputs

  //__enable_fiq(); 
  __enable_interrupt();                 // Enable Interrupts
   
   
   RTICNTR = 0x00;                               // clear 21-bits CNTR
   
   // Loop forever.
  while (1)
  {
      
#if 0
      temp = RTICINT;
      if((temp & 0x80) == 0x80)
      {
         RTICINT &= ~CMP1FLAG;   // interrupt control, clear CMP1
         RTICNTR = 0x00; 
         
         if(flag)
         {
             HETDSET = 0x0100; // Set HET8 outputs
             //flag = 0;
         }
         else
         {
            HETDCLR = 0x0100; // Clear HET8 outputs
            //flag = 1;
         }
         flag = ~flag;
         
      }
     // else
       // HETDSET = 0x0100;
#endif
      
  }

  
}

  //------------------------------------------------------------------------------
// TMS470R1B1M Standard Interrupt Handler
//------------------------------------------------------------------------------

__irq __arm void IRQ_Handler(void)
{
 static unsigned char flag = 0;
 
  switch((0xff & IRQIVEC)-1)
  {
   case CIM_COMP1  : 

   
       	&= ~CMP1FLAG;   // interrupt control, clear CMP1
       RTICNTR = 0x00;                               // clear 21-bits CNTR
       
       if(flag)
       {
           HETDSET = 0x0100; // Set HET8 outputs
           //flag = 0;
       }
       else
       {
          HETDCLR = 0x0100; // Clear HET8 outputs
          //flag = 1;
       }
       flag = ~flag;
     break;
     
     

  }
}

Any type of help regarding this will be appreciated.

P.S. I have also attached the Project which i used for the timer setup.

Regards,

Amjad 

+919920553779

looking for development board and software of TIDA-00011 (Optical HRM)

$
0
0

Hi,

I am looking for source code and development board of TIDA-00011 Optical Heart Rate Monitor Reference Design with BLE Connectivity. Could you please let me know how can obtain them?


Thanks,

Viewing all 262198 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>