Jump to content

Pradeepa

Members
  • Content Count

    82
  • Joined

  • Last visited


Reputation Activity

  1. Like
    Pradeepa got a reaction from bluehash in A portable NRF24L01 C Library for hardware platform integration   
    Hello,
     
    I think it is a good place to post information about this library I prepared. It is a very simple NRF24L01 library. The library is in C and can be used for any hardware platform with very minimal change. Please feel free to comment and criticize.
     
    I tested this using Stellaris Launchpad. Projects using CCS are available in GIT repo.
     
    Blog post:
     
    https://unboxnbeyond.wordpress.com/2015/04/03/pdlib_nrf24l01-v1-01-a-portable-nrf24l01-c-library-for-multiple-hardware-platform-integration/
     
    Git repo:
     
    https://github.com/pradeepa-s/pdlib_nrf24l01
     
    Thank you!!!
  2. Like
    Pradeepa got a reaction from Duloxetinepka in HAPPY NEW YEAR!!!   
    Happy new year fellow "STELLARISians" and "TIVAians"... Have a super year!!!
  3. Like
    Pradeepa reacted to pabigot in How to determine the instructions encoding? [T1, T2,T3,T4]   
    The bit value of the instruction tells you which encoding it is. For example, if it were T1 the first four bits would be 1101 and the instruction value would be 0xd???. Since it's 0xe000 you know it's encoding T2. It can't be T3 or T4 since they'd be 32-bit instructions beginning with 0xf???????.
     
    So it appears to be an unconditional branch to an 11-bit immediate offset from PC, where the value of the offset is zero.
     
    I'm guessing it's an extremely optimized idle loop in an interrupt-driven application.
  4. Like
    Pradeepa reacted to Sahil in Can not save the received characters of UART to a string   
    @
     
    Your point is informative, thank you for that.
  5. Like
    Pradeepa got a reaction from Lyon in GPIO Interrupt Question   
    @@Sahil @@lawrence_jeff,
     
    Recently I saw this post.
     
    Interrupt enabling was never hard for me. So I decided to give some time to figure out what the actual issue in your first code. I think you need to refer the User Guide of the API after going through the introductory lab sessions to get somewhat clearer view on these APIs.
     
    Under NVIC it is specifically mentioned,
     
     
    But in your code you have not done that. You have not enabled interrupts for PORTC.
     
    The workaround proposed works because within the "GPIOPortIntRegister" function internally it calls IntEnable() function. 
     
    My working code looks like below,
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); GPIOPinTypeGPIOInput(GPIO_PORTC_BASE,GPIO_PIN_6); GPIOPadConfigSet(GPIO_PORTC_BASE,GPIO_PIN_6,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU); GPIOIntTypeSet(GPIO_PORTC_BASE, GPIO_PIN_6,GPIO_FALLING_EDGE); GPIOPinIntEnable(GPIO_PORTC_BASE, GPIO_PIN_6); GPIOPinIntClear(GPIO_PORTC_BASE, GPIO_PIN_6); IntMasterEnable(); IntEnable(INT_GPIOC); In addition to this code, I included the interrupt handler in the NVIC under 'GPIO port C' and referred to the handler as an 'extern function'. I think you know about that process.
     
    The difference between the 'workaround' and this method is that when you use "GPIOPortIntRegister" it will dynamically register the Interrupt handler. So the interrupt handler address will be stored in the SRAM. When the processor is actually catering to the interrupt it will have to fetch this address from the SRAM, which will add some latency to the code. 
     
    But if you statically register the interrupt handler through the NVIC, then your flash will contain the required address and the processor do not need to fetch the address from the SRAM. Which will be fast.
     
    If we can save some more clock cycles, it is always better to use that method  if the requirement permits you to do so. It will improve performance and save some power.
     
    Thank you.
  6. Like
    Pradeepa got a reaction from bluehash in RF library for stellaris launchpads   
    Hello zeusemy,
     
    I have been dealing with this issue for a long time. I have ported a library for this. You can find it here. #9th post. 
     
    Try this library. I tested it and worked fine with me. If you have any issues let me know, these days I have some spare time. ( I saw one person could not make it work) 
     
    Good luck.
  7. Like
    Pradeepa got a reaction from Smakkemeken in HAPPY NEW YEAR!!!   
    Happy new year fellow "STELLARISians" and "TIVAians"... Have a super year!!!
  8. Like
    Pradeepa reacted to spirilis in [Energia Library] Nordic nRF24L01+ library   
    I collapsed LM4Bits.h into Enrf24.h and included the new #include's for the platform.
     
    Can you guys verify this works--it builds just fine for me with board set to Stellaris LaunchPad:
    Enrf24_v1_5.zip
     
     
    Changes:
    Version promoted to v1.5
    #include's for Stellaris LaunchPad
    BITx defines for Stellaris LaunchPad
    Enrf24_ChannelScan example modified to use while(1); to halt CPU instead of LPM4 since that isn't available on Stellaris LaunchPad.
    AStelTXdemo example included.
     
    The original Enrf24_* examples only need the pin names changed in the constructor up above to work.  (Haven't actually tested these myself on the Stellaris LP though)
     
    Past changes not included in the prior zip file in this thread:
    Subsequent hits to .available(1) will return TRUE until data is actually read.  Normally .available(1) (only reports data available if RX IRQ present) will report false after the first hit b/c the IRQ is cleared behind the scenes.
    .write() auto-sends only when you try to send a 33rd byte into the buffer
    A .lastTXfailed variable exposed to the user so they can test if the last write() or flush() performed failed (only available with AutoACK, and only at 1Mbps & 2Mbps)
  9. Like
    Pradeepa reacted to L293D in [Energia Library] Nordic nRF24L01+ library   
    Ok, so I ported the Enrf library over so that it works with both MSP430 and Stellaris.  Seems to work great.  I am watching the tx rx demo between msp430g2553 (on the RX side), and the StellarPad doing the TX.  I have included an example in the usual examples folder so you can see how the SPI is setup on the StellarPad. 
     
    Was not much at all to change.  Just added the BIT defs, messed around with the SPI settings and it was up and running.
     
    I am off to bed.
     
    JerodEnrf24ST.zip
  10. Like
    Pradeepa reacted to OzGrant in Connecting Stellaris launchpad and MSP430 through NRF24L01   
    Had the same problem, and solved  as the Enrf24 lib has been updated(today) and all now works ok. It's on the 430 forum.
  11. Like
    Pradeepa reacted to chicken in No lab exercises in stellarisware   
    Did you already check out the Stellaris Launchpad Workshop?
    http://processors.wiki.ti.com/index.php/Getting_Started_with_the_Stellaris_EK-LM4F120XL_LaunchPad_Workshop
     
    Files for lab exercises are in the Workshop Material section of the page.
     
    Regards
    Adrian
  12. Like
    Pradeepa got a reaction from bluehash in GPIOPinRead   
    /*  * main.c  */ #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "inc/hw_gpio.h" #include "driverlib/sysctl.h" #include "driverlib/gpio.h" int main(void) { long pinState; int value = 2; SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN); HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD; HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= 0x01; HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = 0; SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3); GPIOPinTypeGPIOInput(GPIO_PORTF_BASE , GPIO_PIN_0 | GPIO_PIN_4); GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_4 , GPIO_STRENGTH_2MA , GPIO_PIN_TYPE_STD_WPU); while(1){ pinState = GPIOPinRead(GPIO_PORTF_BASE , GPIO_PIN_0 | GPIO_PIN_4); if((pinState & 0x01) == 0x00){ while((pinState & 0x01) == 0x00){ pinState = GPIOPinRead(GPIO_PORTF_BASE , GPIO_PIN_0 | GPIO_PIN_4); } SysCtlDelay(100000); if(value==2){ value = 0; }else { value = 2; } GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, value); } } } this is the kind of code you need.
  13. Like
    Pradeepa got a reaction from igor in Polling the two buttons on the board   
    I blogged this.
     
    http://unboxnbeyond.wordpress.com/2013/04/14/using-button-h-for-inbuilt-buttons/#more-166
  14. Like
    Pradeepa got a reaction from bluehash in Polling the two buttons on the board   
    I blogged this.
     
    http://unboxnbeyond.wordpress.com/2013/04/14/using-button-h-for-inbuilt-buttons/#more-166
  15. Like
    Pradeepa reacted to Lyon in Polling a switch   
    Hi,
    The intended document contained only two pictures with the settings described - having a working project now the document is useless, but I will send you a later, today.
    Glad to have it working.
    Lyon 
  16. Like
    Pradeepa reacted to cosscat in Polling a switch   
    Hello Friend,
     
     
    Try out this code. It will clarify a lot your questions:
     
     
     
    #include "inc/hw_gpio.h" #include "inc/hw_memmap.h" #include "inc/hw_sysctl.h" #include "inc/hw_types.h" #include "driverlib/gpio.h" #include "driverlib/sysctl.h" #define LED_RED GPIO_PIN_1 #define LED_BLUE GPIO_PIN_2 #define LED_GREEN GPIO_PIN_3 #define BUTTON_1 GPIO_PIN_0 #define BUTTON_2 GPIO_PIN_4 void main(void) {         int light;         // configure system clock to run at 50 MHz         // use external crystal (16 MHz) and PLL         SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|         SYSCTL_OSC_MAIN);         // Enable PORT F GPIO         SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);         // Unlock PF0 so we can change it to a GPIO input         // Once we have enabled (unlocked) the commit register then re-lock it         // to prevent further changes.  PF0 is muxed with NMI thus a special case.         HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;         HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= 0x01;         HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = 0;         // set LED pins as outputs         GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN);         // SEE COMMENTS IN THE POST         // set user switches as inputs         GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, BUTTON_1|BUTTON_2);         // turn weak pull-ups on         GPIOPadConfigSet(GPIO_PORTF_BASE, BUTTON_1|BUTTON_2, GPIO_STRENGTH_2MA,         GPIO_PIN_TYPE_STD_WPU);         // loop forever         for (; {                 light = 0;                 if(!GPIOPinRead(GPIO_PORTF_BASE, BUTTON_1))                         light |= LED_RED;                 if(!GPIOPinRead(GPIO_PORTF_BASE, BUTTON_2))                         light |= LED_BLUE;                 GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, light);                 SysCtlDelay(500000);         } }    
    It is derived from a post found on the internet and also a search in buttons.h and buttons.c under StellarisWare directory .
     
    Costin,
  17. Like
    Pradeepa reacted to Lyon in Polling a switch   
    Hi,
    It would be useful to know what tools do you use (CCS/other?) I will assume CCS. The ButtonsPoll function must also be part of your project - so just #include drivers/buttons.h will not suffices. Add to the project the path to this file (in Include paths). Add the file buttons.c to your project, as a symbolic link; this way it will be part of the project, compiled and the linker will find out the code of this function. Do not forget to call also ButtonsInit() before using ButtonsPoll() (yes, you did it..).
    Now, still for CCS, but should be done for other tools: to the Compiler | preprocessor add the followings defined macros:
    DEBUG
    PART_LM4F120H5QR
    TARGET_IS_BLIZZARD_RA1 (this will solve the ROM_xxx complaints..)
     
    Lyon
  18. Like
    Pradeepa reacted to Lyon in Polling a switch   
    Hi,
    To modify settings(i.e. to add predefined symbols) goto Project|Properties|Build| ARM Compiler|Predefined Symbols - click on the green "+" button and add each macro, one by one. If you need later to edit/modify, click on the pencil symbol.The red "+" deletes the macro.
    To define symbolic link, select your project and click in main menu File|Import|FileSystem - then select the folder where it is the file buttons.c, select the file in the right pane and then look for the "Advanced" button - click it and select "Create links in the workspace" Thats it.
    (OK - cannot attach a pdf document - or did not found how to do it).
     Lyon
  19. Like
    Pradeepa got a reaction from sam1426459917 in license of CCS   
    i think there are three licensing options. you need to select the free version i think it s the second to last option when you install the product. 
     
    try to go to Help > Code composer studio licensing information and see whether there is an option to select the licensing file. Else re-install using the free license.
  20. Like
    Pradeepa got a reaction from bluehash in license of CCS   
    i think there are three licensing options. you need to select the free version i think it s the second to last option when you install the product. 
     
    try to go to Help > Code composer studio licensing information and see whether there is an option to select the licensing file. Else re-install using the free license.
×
×
  • Create New...