Jump to content

chicken

Members
  • Content Count

    907
  • Joined

  • Last visited

  • Days Won

    85

Reputation Activity

  1. Like
    chicken got a reaction from tripwire in [POTM] dAISy - A Simple AIS Receiver   
    Thanks for shattering my plans for consumer gadget world domination
     
    Technically the range of AIS is about 50 nautical miles, but that requires an unobstructed view and a properly placed and tuned antenna.
    http://www.marinetraffic.com/p/faq#4
     
    With my wimpy dipole antenna (two straight hookup wires) and the wrong impedance matching (50 ohm instead of 73 for a dipole) I was able to receive the packets from the base station 11 kilometers away when in line of sight. When I was parked at the waterfront with the antenna laying on my car's dashboard, I was able to receive messages of ships in line of sight about 2.5 kilometers away and 500 meters when obstructed by buildings.
  2. Like
    chicken reacted to zeke in Display message in LCD with MSP430   
    Hi @@tony777,
     
    You have to take baby steps with this. Start with the things that you do know and then build up from that.
     
    Are you setup to program in assembler?
    Have you spent some time practicing writing assembly programs yet?
    Have you studied the assembly routines for the target processor yet? Here's the assembly program examples for the msp430g2553.
    What things have you succeeded programming already?
     
    Can you explain to us and yourself exactly what you need to accomplish?
    Do you know how to talk to the LCD peripheral?
    Do you know its language?
     
    Can you draw yourself a diagram of the steps needed to talk to the LCD?
    Can you understand the C code program that talks to the LCD?
     
    Writing an assembly program is almost like teaching a baby how to walk. You have to hold its hand for every step of the way. In this process, you will teach yourself how to think and to act in baby steps.
     
    So now, relax, take a deep breath and writing down all that you know and don't know about the problem.
     
    What needs to happen first? Hint: Look at the C code for clues.
     
    What do you need to tell the micro to do first?
    What's next?
    Make a list of everything that has to occur.
    Teach that micro how to talk to the LCD because it's brand new and knows nothing until you teach it.
     
    Talk it out with yourself or with a friend. Make observations about what you know and don't know. Explain how things work. Listen to yourself. Analyze what you are hearing. Identify the hurdles to climb over.  Then, tackle each hurdle by itself. Then assemble each solution into a bigger program.
     
    Divide and conquer the problem. 
     
    Ask us specific questions to show us that you are working at it.
     
    We can't do your homework for you but we will coach, mentor and encourage you. 
  3. Like
    chicken reacted to yyrkoon in Simple Serial ( minimal ? ) debugging.   
    Here is yet another text only implementation. However, you can use itoa() to convert integers to string format, which in return can then be printed. This does however add some overhead, but is the smallest I have yet tested. Using oPossums Tiny printf() may even yield smaller results.
     
    With the above said, with the G2553 MSP430's "tiny" is not necessarily needed, but is a good exercise in learning how to reduce code size as much as possible ( for when it *is* needed ).
     
    Inspired by Rickta59's Serial / UART code in Energia. In fact, the Initialization code is nearly all his. This is a C++ template class implementation however.
     
    Code size on target.
    Writing 186 bytes at c000... Writing 32 bytes at ffe0... Done, 218 bytes total  
     
    hw_serial.h
    namespace uart { template <uint32_t BAUD, uint32_t MCLK_HZ> struct UART { void Initialize(void); void Write(char ch); void Write(char *str); void Read(void); }; template <uint32_t BAUD, uint32_t MCLK_HZ> void UART<BAUD, MCLK_HZ>::Initialize(void) { const uint32_t baud_rate_20_bit = (MCLK_HZ + (BAUD >> 1)) / BAUD; P1SEL |= BIT1 | BIT2; P1SEL2 |= BIT1 | BIT2; UCA0CTL1 = UCSWRST; UCA0CTL0 = 0; UCA0BR1 = (baud_rate_20_bit >> 12) & 0xFF; UCA0BR0 = (baud_rate_20_bit >> 4) & 0xFF; UCA0MCTL = ((baud_rate_20_bit << 4) & 0xF0) | UCOS16; UCA0CTL1 = UCSSEL_2; } template <uint32_t BAUD, uint32_t MCLK_HZ> void UART<BAUD, MCLK_HZ>::Write(char ch) { while(!(IFG2 & UCA0TXIFG)); UCA0TXBUF = ch; } template <uint32_t BAUD, uint32_t MCLK_HZ> void UART<BAUD, MCLK_HZ>::Write(char *str) { while(*str) { Write(*str++); } } } // end namespace #include <msp430.h> #include <stdint.h> #include "hw_serial.h" using namespace uart; UART<9600, 1000000> Serial; int main(void) { WDTCTL = WDTPW | WDTHOLD; DCOCTL = 0; DCOCTL = CALDCO_1MHZ; BCSCTL1 = CALBC1_1MHZ; BCSCTL2 = DIVS_0; Serial.Initialize(); Serial.Write("Hello World \r\n"); return 0; }
  4. Like
    chicken got a reaction from Laxmi in GNU Scientific Library Compilation Error with Energia 15 for CC3200   
    You have code outside of functions. Try moving the lines starting with w= and work= into setup.
  5. Like
    chicken got a reaction from tripwire in Display message in LCD with MSP430   
    The code looks pretty straight forward. I'd approach translation to assembly like eating an elephant: one bite after the other.
     
    Translate each line of C code to it's equivalent in assembler. Put some extra thought into how to pass parameters into functions.
  6. Like
    chicken got a reaction from yyrkoon in MSP430G2553 multiple interrupts.   
    Not quite sure what the concern is. Just create the 2nd ISR.
     
    The MSP430 will only process one interrupt at a time. If the pin wiggles while you're in the timer ISR, the pin's ISR will be invoked after the timer ISR completes.
  7. Like
    chicken got a reaction from yyrkoon in Compiler optimization traps for the unaware   
    @@yyrkoon if there's an interrupt using that flag to determine whether it's save to use the buffer you may be in trouble.. occasionally.
     
    While not advisable on real mutlithreaded OS'es, using a volatile flag for "interprocess" communication is pretty common practice on MCUs.
  8. Like
    chicken got a reaction from yyrkoon in Compiler optimization traps for the unaware   
    Here's a very interesting presentation about how modern compiler optimization may lead to unexpected results. This goes way beyond the failure of naive delay loops.
    http://www.eng.utah.edu/~cs5785/slides-f10/Dangerous+Optimizations.pdf
     
    If you ever relied on buffer indices wrapping around (integer overflow), this is a must read. There are many other scenarios discussed.
     
    For example I'm pretty sure I fell for this trap myself:
    volatile int buffer_ready; char buffer[BUF_SIZE]; void buffer_init() { for (size_t i = 0; i < BUF_SIZE; i++) buffer[i] = 0; buffer_ready = 1; } It probably works today. But it's a bug waiting to happen when I recompile with different optimization settings or a different compiler. (hint: buffer_ready=1 may be moved before the for loop because the loop does not affect any volatile location).
     
  9. Like
    chicken reacted to Fmilburn in [POTM] dAISy - A Simple AIS Receiver   
    dAISy Ethernet Adapter

    The dAISy Ethernet Adapter packages a dAISy AIS Receiver in an enclosure with a W5500 Ethernet module and a MSP430G2955 to control it.  With the addition of a marine VHF antenna, power via USB, and an Ethernet connection local marine traffic can be reported to the internet:

    The simplified block diagram below shows the main components:

    The MSP430G2995 was chosen over the more common MSP430G2553 for its additional RAM and was adapted to Energia and an Ethernet library ported.  Relatively large SMD components (e.g. 0805 resistors and capacitors, 38 pin TSSOP microcontroller) were chosen to allow hand soldering if desired.
     
    The finished product is shown below with the enclosure open:

    The project was a collaboration with @@chicken.
     
    Links and References
    dAISy 43oh thread: http://forum.43oh.com/topic/4833-potm-daisy-a-simple-ais-receiver/
    dAISy Tindie:  https://www.tindie.com/products/astuder/daisy-ais-receiver/
    MSP430G2955 Energia: https://github.com/fmilburn3/MSP430G2955_EnergiaPinmap
    W5500 Energia: https://github.com/fmilburn3/W5500_Ethernet
     
  10. Like
    chicken got a reaction from tripwire in Compiler optimization traps for the unaware   
    Here's a very interesting presentation about how modern compiler optimization may lead to unexpected results. This goes way beyond the failure of naive delay loops.
    http://www.eng.utah.edu/~cs5785/slides-f10/Dangerous+Optimizations.pdf
     
    If you ever relied on buffer indices wrapping around (integer overflow), this is a must read. There are many other scenarios discussed.
     
    For example I'm pretty sure I fell for this trap myself:
    volatile int buffer_ready; char buffer[BUF_SIZE]; void buffer_init() { for (size_t i = 0; i < BUF_SIZE; i++) buffer[i] = 0; buffer_ready = 1; } It probably works today. But it's a bug waiting to happen when I recompile with different optimization settings or a different compiler. (hint: buffer_ready=1 may be moved before the for loop because the loop does not affect any volatile location).
     
  11. Like
    chicken got a reaction from Fmilburn in Compiler optimization traps for the unaware   
    Here's a very interesting presentation about how modern compiler optimization may lead to unexpected results. This goes way beyond the failure of naive delay loops.
    http://www.eng.utah.edu/~cs5785/slides-f10/Dangerous+Optimizations.pdf
     
    If you ever relied on buffer indices wrapping around (integer overflow), this is a must read. There are many other scenarios discussed.
     
    For example I'm pretty sure I fell for this trap myself:
    volatile int buffer_ready; char buffer[BUF_SIZE]; void buffer_init() { for (size_t i = 0; i < BUF_SIZE; i++) buffer[i] = 0; buffer_ready = 1; } It probably works today. But it's a bug waiting to happen when I recompile with different optimization settings or a different compiler. (hint: buffer_ready=1 may be moved before the for loop because the loop does not affect any volatile location).
     
  12. Like
    chicken got a reaction from enl in Compiler optimization traps for the unaware   
    Here's a very interesting presentation about how modern compiler optimization may lead to unexpected results. This goes way beyond the failure of naive delay loops.
    http://www.eng.utah.edu/~cs5785/slides-f10/Dangerous+Optimizations.pdf
     
    If you ever relied on buffer indices wrapping around (integer overflow), this is a must read. There are many other scenarios discussed.
     
    For example I'm pretty sure I fell for this trap myself:
    volatile int buffer_ready; char buffer[BUF_SIZE]; void buffer_init() { for (size_t i = 0; i < BUF_SIZE; i++) buffer[i] = 0; buffer_ready = 1; } It probably works today. But it's a bug waiting to happen when I recompile with different optimization settings or a different compiler. (hint: buffer_ready=1 may be moved before the for loop because the loop does not affect any volatile location).
     
  13. Like
    chicken got a reaction from spirilis in Compiler optimization traps for the unaware   
    Here's a very interesting presentation about how modern compiler optimization may lead to unexpected results. This goes way beyond the failure of naive delay loops.
    http://www.eng.utah.edu/~cs5785/slides-f10/Dangerous+Optimizations.pdf
     
    If you ever relied on buffer indices wrapping around (integer overflow), this is a must read. There are many other scenarios discussed.
     
    For example I'm pretty sure I fell for this trap myself:
    volatile int buffer_ready; char buffer[BUF_SIZE]; void buffer_init() { for (size_t i = 0; i < BUF_SIZE; i++) buffer[i] = 0; buffer_ready = 1; } It probably works today. But it's a bug waiting to happen when I recompile with different optimization settings or a different compiler. (hint: buffer_ready=1 may be moved before the for loop because the loop does not affect any volatile location).
     
  14. Like
    chicken reacted to greeeg in 4 x 6 cm Projects   
    Something cool I've found out about these 4x6cm PCBs. shave off about a mm from one side and the fit perfectly into Hammond aluminium extrusion 1455D602 (http://www.hammondmfg.com/1455V2.htm)
    [Not affiliated, just thought it might benifit someone]
     

  15. Like
    chicken got a reaction from tripwire in RANT: Cloud of this, IoT of that . . .   
    That's why emails with cloud and IoT in the title usually get deleted unopened.
     
    That being said, I think the webinar description is pretty clear and level-headed. It's about means for secure communication between the gateway and a node. Probably TLS and some such. Not sure where you got the end-of-the-world and ultimate-security-solution-for-everything vibe from.
  16. Like
    chicken got a reaction from yyrkoon in RANT: Cloud of this, IoT of that . . .   
    That's why emails with cloud and IoT in the title usually get deleted unopened.
     
    That being said, I think the webinar description is pretty clear and level-headed. It's about means for secure communication between the gateway and a node. Probably TLS and some such. Not sure where you got the end-of-the-world and ultimate-security-solution-for-everything vibe from.
  17. Like
    chicken got a reaction from spirilis in RANT: Cloud of this, IoT of that . . .   
    That's why emails with cloud and IoT in the title usually get deleted unopened.
     
    That being said, I think the webinar description is pretty clear and level-headed. It's about means for secure communication between the gateway and a node. Probably TLS and some such. Not sure where you got the end-of-the-world and ultimate-security-solution-for-everything vibe from.
  18. Like
    chicken reacted to Fmilburn in 4 x 6 cm Projects   
    I have had a package of those 4x6 cm pcb boards with 0.1" spacing for a while and realized this evening that I was about to run out.  They are a good and useful size.  Wondering where they all went I rummaged around and found these and there are more scattered about in various enclosed projects.
     

     
    I am in the habit of soldering one up if it is on the breadboard and I think there is a fair chance I might use it again.  I like to do this even when I am going to have PCBs fabricated.  From top left and going clockwise they are a RFID BoosterPack reader, a Nokia 5110 BoosterPack, an INA125P BoosterPack paired with a strain gauge, a breadboard BoosterPack, a MSP430G2553 Prototyping Board, and a MSP430G2955 Prototyping Board.  The G2955 is a 38 pin TSSOP so it is on an adapter.   The latest one is the Nokia 5110 I put together this afternoon.
     

     
    I had the idea that SMD parts might be directly soldered to these boards.  Here is a 0805 resistor soldered onto a piece of scrap (crooked but OK) with a SOT-223-4 part next to it.  The SOT-223 isn't soldered, I just put it there to show it aligned fairly well.  I ordered an inexpensive selection of 0805 resistors and capacitors and will be using them instead of through hole components to see how they do.
     

     
    Meanwhile, I haven't given up having PCBs fabricated, but this is handy.  What I really need want is a CNC mill.
  19. Like
    chicken got a reaction from pine in Chrome for portable UI development (serial, USB)   
    @@yyrkoon LOL Nope.
  20. Like
    chicken got a reaction from pine in Chrome for portable UI development (serial, USB)   
    Here's a tutorial on programming a graphical UI in Google Chrome to display data received over serial
    http://www.lucadentella.it/en/2016/06/07/chrome-app-e-comunicazione-seriale/
    via Dangerous Prototypes.
     
    I meant looking into this topic for a long time. For serial communication like in this tutorial, but also USB for a portable upgrade application via a custom USB BSL implementation.
     
  21. Like
    chicken got a reaction from yyrkoon in Chrome for portable UI development (serial, USB)   
    The main advantage is, that this will work for everyone that has Google Chrome. No need to install additional environments like nodejs, python etc., which is a huge benefit if you try to minimize hand-holding for potential users of your application.
  22. Like
    chicken got a reaction from yyrkoon in Chrome for portable UI development (serial, USB)   
    Here's a tutorial on programming a graphical UI in Google Chrome to display data received over serial
    http://www.lucadentella.it/en/2016/06/07/chrome-app-e-comunicazione-seriale/
    via Dangerous Prototypes.
     
    I meant looking into this topic for a long time. For serial communication like in this tutorial, but also USB for a portable upgrade application via a custom USB BSL implementation.
     
  23. Like
    chicken got a reaction from oPossum in Chrome for portable UI development (serial, USB)   
    Here's a tutorial on programming a graphical UI in Google Chrome to display data received over serial
    http://www.lucadentella.it/en/2016/06/07/chrome-app-e-comunicazione-seriale/
    via Dangerous Prototypes.
     
    I meant looking into this topic for a long time. For serial communication like in this tutorial, but also USB for a portable upgrade application via a custom USB BSL implementation.
     
  24. Like
    chicken got a reaction from solipso in Chrome for portable UI development (serial, USB)   
    Here's a tutorial on programming a graphical UI in Google Chrome to display data received over serial
    http://www.lucadentella.it/en/2016/06/07/chrome-app-e-comunicazione-seriale/
    via Dangerous Prototypes.
     
    I meant looking into this topic for a long time. For serial communication like in this tutorial, but also USB for a portable upgrade application via a custom USB BSL implementation.
     
  25. Like
    chicken got a reaction from Rei Vilo in Chrome for portable UI development (serial, USB)   
    Here's a tutorial on programming a graphical UI in Google Chrome to display data received over serial
    http://www.lucadentella.it/en/2016/06/07/chrome-app-e-comunicazione-seriale/
    via Dangerous Prototypes.
     
    I meant looking into this topic for a long time. For serial communication like in this tutorial, but also USB for a portable upgrade application via a custom USB BSL implementation.
     
×
×
  • Create New...