Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. yea yea ok thank you for your reply
  3. Yesterday
  4. johnsondavies

    SD.h: No such file or directory

    Thank you - I'll try it. It would be great if it could be made a standard part of the Arduino core, like on other platforms.
  5. Rei Vilo

    SD.h: No such file or directory

    There is an official SD library that works great against the MSP430. Just search a little. I'm using the SD library from Sparkfun with very limited adaptation. Latest release of MSP430 boards for Energia is 1.0.5.
  6. johnsondavies

    SD.h: No such file or directory

    Checking back through my notes I've realised that I never had my program working with an SD Card library, so you can close this thread. However, it would be very useful if Arduino-compatible SD card support could be added to the Arduino core for the MSP430 range at some stage.
  7. StefanSch

    Port manipulation on msp-EXP430G2

    On MSP430 device you can access the port with mainly three registers: PxIN : read input from port x (8 Bit) PxOUT : set output level on port x (8 Bit) (only if direction set to output) PxDIR : set direction on port x (0:input 1: output) where x is the port number e.g. Read input inputvalue = P2IN; Set port P2.0 to output high P2DIR = 0x01; P2OUT = 0x01;
  8. Last week
  9. Hi, I have got a hc-05 Bluetooth module, an MSP-EXP430FR4133 board. Now I want to connect them with my computer. However, even I successfully send data from my computer to control the MSP430, it cannot send data back. Can someone tell me what I can do? Here is my code. By the way, I'm using energia for it and set my HC-05 as a slave module. _________________________________________________ // most launchpads have a red LED #define LED RED_LED //see pins_energia.h for more LED definitions //#define LED GREEN_LED void setup() { Serial.begin(9600); /* Define baud rate for serial communication */ pinMode(LED, OUTPUT); } void loop() { if (Serial.available()>0) /* If data is available on serial port */ { char state = Serial.read(); /* Data received from bluetooth */ if (state == '0') { digitalWrite(LED, HIGH); Serial.write("LED turned ON"); state=0; } else if (state == '1') { digitalWrite(LED, LOW); Serial.write("LED turned OFF"); state=0; } } ----------------------------------------------------------------------------------------------------------------------- Waiting for replay! Thank you Kelly
  10. Sorry meant : you may can contact.....
  11. Thank you for you reply. Yes please do contact.
  12. Looks like that the variable ucg_font_mode_fnptr is not defined in the library. I may can contact the vendor of the library for support.
  13. MCH

    Timer triggered A/D on the f5529 ?

    I found the answer here: https://e2e.ti.com/support/microcontrollers/msp430/f/166/p/93961/326902#326902 SHS_1 is TA0 CCR1, as I already found out SHS-2 is TB CCR0 and SHS_3 is TB CCR1. Bljah, I'll have to redesign my PCB 😞
  14. MCH

    Timer triggered A/D on the f5529 ?

    Hello NurseBob, There is a hardware connection between timers and ADC, that allows you to trigger the ADC directly from a timer, no need to do it "by hand" in a timer interrupt. This provides constant sampling intervals, independent of any software latencies. I have been successfully using this feature on MSP430G2553. Now I am porting to F5529, and ran into this problem. In the mean time, by trial and error, I found that ADC12SHS_1 in ADC12CTL1 will trigger from timer A0.1, but can't find out from which timer ADC12SHS_2 and ADC12SHS_3 trigger. (The family manual clearly says from some timer, but does not specify which,. It refers to the specific device datasheet, but neither can I find the info there.) I need timers A0 and B (many CCRs) for other tasks, and would like to trigger the ADC from one of the "small" timers, A1 or A2.
  15. hello, Im trying to interface a 2 inch rgb LCD display with ST7789v lcd driver im using the ucglib library for this i get a few errors stating not been declared need assistance with this please. I attached the library used and the screen shot. ucglib-master_editted.zip
  16. NurseBob

    SD card bootloader - convert assembler to C++?

    In addition to Rickta59's reply, you may want to read-up on bootloaders. TI published SLAA600D to help with such a task (in C, not C++)
  17. NurseBob

    Timer triggered A/D on the f5529 ?

    Hi MCH, Basically, the timer(s) and ADC are indpendent peripherals. So, what you do is set a timer at the interval you're interested in and either: 1) In the timer event handler trigger the ADC to read Or, 2) Set a flag that's read in a main loop to trigger the ADC You might find some guidance here. HTH
  18. Peabody

    SD card bootloader - convert assembler to C++?

    Thanks very much for your replies. I'll go back and study what you've said, but it kinda looks like it just needs to stay in Naken assembler. That produces a .hex file which I flash to the chip with TI's MSP Flasher. There is no "environment". And I think any attempt to convert it to C is just bound to make it larger and less efficient.
  19. Rickta59

    SD card bootloader - convert assembler to C++?

    So I spent some time with the latest energia 1.8.7E21. It is still using msp430-gcc. That project I linked in the previous post won't work because that code is using the newer msp430-elf-gcc. I did put together an example of using msp430-gcc style code and the blink project above that compiles and create asm only project .. well almost main has to jump to our asm code so there are a couple of instructions to get there. Three files are needed: blink_with_msp430-gcc_asm.ino /* blink_with_msp430-gcc_asm.ino */ /* * we aren't going to use the .ino file */ main.cpp // We override the main function from Energia // and just jump to our __reset_vector__ routine // in blink.S int main() { asm("jmp _reset_vector__"); } blink.S ;------------------------------------------------------------------------------- ; blinkasm.S - gcc compatible interrupt driven led blinker in msp430 asm ; ; Version 1.0 - 10/22/2011 rick@kimballsoftware.com ; Version 1.01 - 7/22/2014 rick@kimballsoftware.com modified for msp430-elf-gcc ; Version 1.02 - 11/02/2014 rick@kimballsoftware.com more changes for msp430-elf-gcc ; $ msp430-elf-gcc blinkasm.S -D_GNU_ASSEMBLER_ -Wall -Os -g \ ; -fdata-sections -ffunction-sections -mmcu=msp430g2553 -T \ ; -T msp430g2553.ld -I/tmp/a/include -L /tmp/a/include/ -nostdlib ; Version 1.03 - 03/16/2019 rick@kimballsoftware.com made compatible with energia ; ;------------------------------------------------------------------------------- .file "blinkasm.S" #include <msp430.h> ;------------------------------------------------------------------------------- ;;; ---- gcc doesn't know about PC,SP,SR,CG1,CG2 ---- #define PC r0 #define SP r1 #define SR r2 ;------------------------------------------------------------------------------- ;;; ---- CONSTANTS ---- //#define TEST_IRQ_OVERHEAD #ifndef TEST_IRQ_OVERHEAD #define _50USEC (50-1) /* @1MHz MCLK results in 50uSec/interrupt */ #define _500MSEC 10000 /* @1MHz MCLK results in 500ms/LED toggle */ #else ;; This test illustrates the minimum CCR0 value that can be used ;; 22 cycles is based on the interrupt overhead #define _50USEC 22 /* @1MHz MCLK results in 23uSec/interrupt */ #define _500MSEC 1 /* @1MHz MCLK results in 23uSec/LED toggle */ #endif #define _LED_PIN BIT6 /* PORT1 pin, Launchpad has BIT0=Red and BIT6=Green */ ;------------------------------------------------------------------------------- ;;; ---- Registers used as globals ---- #define LED_PIN r4 #define TIMER_CYCLES r5 #define INTERVAL_CNT r6 #define CNT r7 ;; or you could use some ram variables .lcomm tcycles,2 ; example use of local bss data variable .lcomm cnt,2 ; example use of local bss data variable ;------------------------------------------------------------------------------- .section .text,"ax",@progbits ;------------------------------------------------------------------------------- .global _reset_vector__ ; it is important to name it "_reset_vector__" ; we prevent the C runtime start code from getting ; linked by using this name _reset_vector__: ;; disable watchdog and set stack to highest RAM addr mov.w #WDTPW|WDTHOLD,&WDTCTL mov.w #__stack,SP ; gcc ldscripts compute __stack based on mmcu ;; initialize clock,gpio,timer init: ;; configure DCO to precalibrated 1MHz clr.b &DCOCTL mov.b &CALBC1_1MHZ,&BCSCTL1 mov.b &CALDCO_1MHZ,&DCOCTL ;; initialize global register values mov.w #_LED_PIN,LED_PIN ; load constant into register constant mov.w #_50USEC,TIMER_CYCLES ; load constant into register constant mov.w #_500MSEC,INTERVAL_CNT ; load constant into register constant mov.w INTERVAL_CNT,CNT ; initialize register based counter ;; initialize GPIO bic.b LED_PIN,&P1OUT ; LED turned off to start bis.b LED_PIN,&P1DIR ; Configure P1.0 as output pin ;; initialize TimerA0 mov.w #CCIE,&TA0CCTL0 ; Enable TA0CCR0 interrupt mov.w TIMER_CYCLES,&TA0CCR0 ; Set TIMER_CYCLES cycles mov.w #TASSEL_2|MC_2,&TACTL ; SMCLK, Continuous Up Mode ;; enable interrupts and loop forever ;; real work done in the CCR0 interrupt nop eint loop: ;; Note: could sleep here instead jmp loop ; cycles:2 ;------------------------------------------------------------------------------- ; TIMER0_A3_ISR - Timer0_A3 CCR0 interrupt handler for vector 0xfff2 ;------------------------------------------------------------------------------- .global __isr_9 ; to insert an interrupt vector into the vector ; table from assembly, we have to use a specific ; naming convention we must call this function ; "__isr_9" this forces it into the 9th vector ; slot counting from 0 starting memory address ; 0xffe0. It is 9 because each vector is ; 2 bytes so we end up in slot 0xfff2 ; all this is because of the way msp430-gcc ; works with interrupts ; .vectors in the msp430g2553/memory.x starts ; @ 0xffe0 ; there are numbered isr_0 ... isr_14 even though ; there are 16 vectors. isr_15 is actually called ; _reset_vector__ you can see how we use it in this ; code. ; see the file: ; http://www.ti.com/lit/ds/symlink/msp430g2553.pdf ; look at the "Interrupt Vector Table" page 11 __isr_9: ;; before we even start running the mcu does a push PC, and a push SR cycles:6 dec.w CNT ; have we looped INTERVAL_CNT times? cycles:1 jnz 1f ; exit if we haven't reached 0 cycles:2 ;; toggle led pin after (INTERVAL * TIMER_CYCLES) has occured xor.b LED_PIN,&P1OUT ; cycles:4 mov.w INTERVAL_CNT,CNT ; reinitialize interval counter cycles:1 1: add.w TIMER_CYCLES,&TA0CCR0 ; set new CCR0 and go again cycles:4 reti ; cycles:5 ; vim: ts=8 sw=8 expandtab: Put those in a new Energia sketch compile it for an msp430g2553 and it should produce output that looks like this: blink_with_msp430-gcc_asm.ino.elf: file format elf32-msp430 Disassembly of section .text: 0000c000 <main>: c000: 03 3c jmp $+8 ;abs 0xc008 c002: 0f 43 clr r15 0000c004 <__ctors_end>: c004: 30 40 5e c0 br #0xc05e 0000c008 <_reset_vector__>: c008: b2 40 80 5a mov #23168, &0x0120 ;#0x5a80 c00c: 20 01 c00e: 31 40 00 04 mov #1024, r1 ;#0x0400 0000c012 <init>: c012: c2 43 56 00 mov.b #0, &0x0056 ;r3 As==00 c016: d2 42 ff 10 mov.b &0x10ff,&0x0057 c01a: 57 00 c01c: d2 42 fe 10 mov.b &0x10fe,&0x0056 c020: 56 00 c022: 34 40 40 00 mov #64, r4 ;#0x0040 c026: 35 40 31 00 mov #49, r5 ;#0x0031 c02a: 36 40 10 27 mov #10000, r6 ;#0x2710 c02e: 07 46 mov r6, r7 c030: c2 c4 21 00 bic.b r4, &0x0021 c034: c2 d4 22 00 bis.b r4, &0x0022 c038: b2 40 10 00 mov #16, &0x0162 ;#0x0010 c03c: 62 01 c03e: 82 45 72 01 mov r5, &0x0172 c042: b2 40 20 02 mov #544, &0x0160 ;#0x0220 c046: 60 01 c048: 03 43 nop c04a: 32 d2 eint 0000c04c <loop>: c04c: ff 3f jmp $+0 ;abs 0xc04c 0000c04e <__isr_9>: c04e: 17 83 dec r7 c050: 03 20 jnz $+8 ;abs 0xc058 c052: c2 e4 21 00 xor.b r4, &0x0021 c056: 07 46 mov r6, r7 c058: 82 55 72 01 add r5, &0x0172 c05c: 00 13 reti 0000c05e <_unexpected_>: c05e: 00 13 reti Disassembly of section .vectors: 0000ffe0 <__ivtbl_16>: ffe0: 04 c0 04 c0 04 c0 04 c0 04 c0 04 c0 04 c0 04 c0 ................ fff0: 04 c0 4e c0 04 c0 04 c0 04 c0 04 c0 04 c0 08 c0 ..N............. To get your SD Card Bootloader running in Energia you would have to replace the blink.S with SDBSL-G2553.S and change your coding style to make msp430-gcc happy. You would also have to replicate all the code that the normal C runtime code does to create an environment for a C++ application. Basically you have to setup the .data section (copying the initial values from flash to ram), initialize the .bss section all to zero, loop through all the global c++ constructors, then call the users main function. blink_with_msp430_asm.zip
  20. As the title states, I need help coding an LED cube consisting of 27 RGB LEDs. I am very new to Charlieplexing and I have no idea how to wire it. I have attached the document that I am using to map out my wiring. Please help me complete it! I just need to know what wires I should connect. Thank you! https://ibb.co/jJKVW1Q (actual hardware) https://ibb.co/H7SFxDM (actual hardware) https://ibb.co/yq2Yyd2 (actual hardware) https://ibb.co/1RYFdfK (layout of every LED column) https://ibb.co/3hrMtcj (diagram for 1st set of wires) https://ibb.co/6sdhbjq (diagram for 2nd set of wires) https://ibb.co/tcPSxF0 (diagram for 3rd set of wires) https://ibb.co/Lvtsd8q (diagram for 4th set of wires)
  21. Rickta59

    SD card bootloader - convert assembler to C++?

    Interesting stuff. Here are some things that seem like they might cause you issues: Rewriting in C++ can be small. Using the Energia API will defeat that and not result in a 1k sd card bootloader. Cross Platform issues, Energia supports Windows, OS/X, and Linux. You need to supply the binaries for all the tools you are using that run on all platforms. It is easiest to stick with the gcc object tools for manipulating the .hex file. Naken asm source - No one has that so you either provide the naken assembler binary. Alternatively, if you want to just go with assembler + Energia, you might rewrite your asm code so that it is compatible with msp430-gcc assembly. I think Energia still takes .S files (gcc assembler source) The biggest difference between naken and gcc is having an external linker script for the symbol addresses you have hard coded in the .m43 source code. You are facing the same kinds of issues I bumped up against doing a small GDB bootloader. However, I was trying to avoid being part of the user code or changing the way Energia sets up the linker scripts. I'm not sure you can overcome that without getting into the details of the vector table and the linker script. You might find this useful: https://gist.github.com/RickKimball/ead0b3b0f28f0dbf426c51f46ced59ab
  22. I just posted a Github repo on a 1K SD card bootloader for the G2553 and G2452: https://github.com/gbhug5a/SD-Card-Bootloader-for-MSP430 It's written in assembler, but that's not really accessible to most people who use Energia. So I wondered if it would be possible to rewrite it in C++. But I don't understand much about how C++ does things, and don't know if it's possible to do the same things in the same space, or anywhere near the same space. My code uses all 12 general purpose registers, mainly because operations on registers are smaller instructions than operations on memory locations. Also, I specify in ram the exact location of every bit of ram I use, other than the stack of course. It all fits in 1K, but with exactly four bytes to spare. If I do away with setup() and loop(), and just stick with a main(), is it possible to do stuff like this in Energia? Is it possible to specify exactly where things will be located? Are there any examples of doing this kind of conversion? Well, this may be a bridge too far. But I thought I would ask. I was also thinking that if the C++ code worked in Energia, it could possibly be ported back to the Arduino world.
  23. I would like to trigger the sampling from a timer, but somehow cannot find the required information about the ADC12SHS bits in the ADC12CTL1 register. The family manual tells me to look in the specific device datasheet for that information, but I can't find it there (the MSP430F5529 datasheet). Also looked into the mspware C examples, but none uses timer triggered A/D. Where should I look for that info (which timers can be used, and how to set ADC12SHS bits to use them)?
  24. Srivenkat

    CC3200

    I need to send serial data from tx pin of em18 to rx pin of cc3200. However, there is no specific rx pin for cc3200. I need to software code it but I'm having pretty tough time with it. Can anyone help me?
  25. Updating in case anyone in the future has the same problem as me: Finally figured out what my issue was. I had left some prints to Serial() in the sketch I was using. Apparently Serial() on the F5529 uses the same I/O pins I was using for my new SPI ports, so when Serial would use those pins it would mess with the WiFi module I had set up. The usci_spi and pins_energia files I had in my last post should work, provided you don't have any Serial prints. If you do, make sure to assign the Serial to other pins. All in all, I think I chose my username well
  26. Earlier
  27. Hi all, I've just installed Energia and am trying to upload blinky to an G2553 Launchpad: Using new (SLAC460L+) API MSP430_GetNumberOfUsbIfs MSP430_GetNameOfUsbIf Found FET: COM11 MSP430_Initialize: COM11 tilib: MSP430_VCC: Could not set device Vcc (error = 10) Firmware version is 31000003 MSP430_VCC: 3000 mV tilib: device initialization failed the selected serial port tilib: device initialization failed does not exist or your board is not connected Any ideas about what I might be doing wrong? thank you.
  28. Nicoloquitne

    Port manipulation on msp-EXP430G2

    Hello I'm trying to read all the IO from a port (port 2) on my M430G255 MCU . On arduino I could have use the line DDRB = B11111111; data = PINB; I've read some posts but no one talks about port manipulation on energia and msp boards clearly. can someone help me figure out how to woks with registers and msp boards ? thanks EDIT : I found the register file on the energia installation folder, but every time that i try to charge e a register I get the error: expected unqualified-id before numeric constant
  1. Load more activity
×