Dear Mr/Ms:
I am trying to access the CC2531 and CC530 unique id numbers that are part of the TI manufacturing process. I want to use this ID/address as a way of sending Zigbee messages to a specific CC2530 device. Does anyone know this memory location. The documentation does not seem to call it out.
Thank you in Advance
AL McBride
Take a look at how the IEEE is resolved in ZMain.c in the function zmain_ext_addr(void) - I suspect you are looking for this address:
(uint8 *)(P_INFOPAGE+HAL_INFOP_IEEE_OSET)
Thank you for the reply. After more digging I found this in the CC253X User Guide pg 27
"The Information Page is a 2-KB read-only region that stores various device information. Among other things, it contains for IEEE 802.15.4 or
Bluetooth low energy compliant devices a unique IEEE address
from the TI range of addresses. For CC253x, this is a 64-bit IEEE address stored with least-significant
byte first at XDATA address 0x780C. For CC2540, this is a 48-bit IEEE address stored with
least-significant byte first at XDATA address 0x780E."
Also to access this memory I found using the following worked.
uint8 volatile __xdata *ptr;
ptr = &XREG(0x780C);
firstbyte = *ptr;
Best
Al
Thanks a lot Mcbride its working
You are most welcome. Looks like you were faster to get it all working than I was. Good for you. We should be so called poster boys for TI on this.
My systems using the CC2531/2530 and MSP430 micros continue to work just fine as well.
Cheers
Al McBride
Thanks Al McBride
Do u have any sample code for sleep mode timer ?
i worked on it
1) when i used external wake up interrupt ,,,it wake up only one time ,,,, then goes to undefined state
2)When i used sleep timer interrupt ,,, it goes in sleep and didn't wake up
if u have time then i can send you the codes
Thanks
Muhammad:
I have implemented a so called sleep mode timer for the MSP430 micro I use in my product. I would be happy to look at your code. Maybe you can tell me what type of application you are developing and obviously what SOC you are using.
Your posting was timestamped as of 2:47AM. You either work very late or are in another timezone. :)
Where are you located if I may ask.
Al McBride :
yes i am at +6 GMT . i am using CC2530 .My application is Telemetry , iSending Specific Commands From Arm7(LPC2136) via cc2530(As a RF Transceiver ) to another
cc2530 which is attached to meter end . Now my task is to use sleep timer at meter end cc2530 which have to wake after every hour communicate with meter and send data back to Arm7(LPC2136) via another cc2530
Two solutions
1)External interrupt wake up but for that i have to remain on my reciever which consume power
2)sleep timer ,,which wakes up cc2530 after every hour communicate and sleep
Its Working now i wake it up every 5 second and then sleep
#include <ioCC2530.h>
unsigned char volatile __xdata *ptr;unsigned char firstbyte[8];void Delay(){ unsigned int k; for(k=0; k<65535; k++);}
void SendChar1(unsigned char Get){
U1DBUF=Get; while(!UTX1IF); UTX1IF = 0; }
void Serial_Int(){ CLKCONCMD=0x00;
U0CSR |= 0x80; //UART mode selected for USART0.
U1CSR |= 0x80; //UART mode selected for USART0.
// U0UCR &= ~0x40; //H/w flow control disabled.
PERCFG &= ~0x01; //Alernative 1 selected for UART0 peripheral.
PERCFG |= 0x02; //Alernative 1 selected for UART0 peripheral.
P0SEL |= 0x0C; //P0.2 and P0.3 peripheral mode enabled. P1SEL |= 0xF0; //P0.2 and P0.3 peripheral mode enabled. // P1SEL &= ~0xF0;
U0GCR |= 0x08; U0BAUD = 0x3B; //Baud rate set to 9600 bps.
U1GCR |= 0x08; U1BAUD = 0x3B; //Baud rate set to 9600 bps.
}
static void SleepTimerInit(void);unsigned char i,j;int main (void){ P0DIR=0x03; i=0; j=0; P0_0=0; P0_1=0; Serial_Int(); SleepTimerInit();
SLEEPCMD |= 0x06; // Setting power mode 2 PCON |= 0x01; // Enable power mode
while (1){ Delay(); P0_0=0; Delay(); Delay(); Delay(); Delay(); Delay(); Delay(); P0_0=1; PCON |= 0x01; // Enable power mode
static void SleepTimerInit(void){ unsigned long sleeptime = 0; sleeptime |= ST0; sleeptime |= (unsigned long)ST1 << 8; sleeptime |= (unsigned long)ST2 << 16; sleeptime += ((unsigned long)5 * (unsigned long)32753); /* set sleep timer */ while((STLOAD & 0x01) == 0); // wait before ST0. STLOAD.LDRDY is 0 during the load ST2 = (unsigned char)(sleeptime >> 16); ST1 = (unsigned char)(sleeptime >> 8); ST0 = (unsigned char) sleeptime; STIE=1; // IRCON |= 0x80; IEN0 |= 0x20; EA = 1; // Enable global interrupt PCON=0X01;//go to sleep}
#pragma vector=ST_VECTOR
__interrupt void sleeptimer_int()
{
unsigned long sleeptime = 0;STIF = 0; //clear interrupt flag
sleeptime |= ST0; sleeptime |= (unsigned long)ST1 << 8; sleeptime |= (unsigned long)ST2 << 16; sleeptime += ((unsigned long)10 * (unsigned long)32753); /* set sleep timer */ while((STLOAD & 0x01) == 0); // wait before ST0. STLOAD.LDRDY is 0 during the load ST2 = (unsigned char)(sleeptime >> 16); ST1 = (unsigned char)(sleeptime >> 8); ST0 = (unsigned char) sleeptime; P0_0=0;
Delay(); P0_0=1;
Delay(); Delay(); Delay();
Sounds like your code is fine now. FYI, what I did for the MSP430 micro (which I assume would work on the CC2530 though I have not done that yet) was to use the built in timer_a which when configured generates an interrupt for at whatever frequency you wish and in the timer interrupt routine I exit the sleep state (LPM3) after a certain number of interrupts. My main code simply is a infinite while loop and I enter LPM3 within the loop and when the interrupt routine exits LPM3 my main loop does its thing and renenters the LPM3 state. For the MSP430 in the LPM3 state the micro only takes a few microamps to stay alive and run the timer.
From briefly looking at your code I believe my approach may save you code space if that is an issue.