Jump to content
43oh

JWoodrell

Members
  • Content Count

    445
  • Joined

  • Last visited

  • Days Won

    17

Reputation Activity

  1. Like
    JWoodrell got a reaction from Fmilburn in MSP430 how to make WS2811Driver reduce from 800 kHz to 400 kHz link inside   
    personally I use the SPI method exclusively for the smart LEDs  (WS2812B, and sk6812 recently)  one trick for getting the timing to cooperate is to set the SPI divider to get you close then you can change the rate of the MCLK registers to fine tune the timing.  it only has to be changed while the SPI is transmitting so you can change the clock back to normal "speed" after your done with the transmission.
  2. Like
    JWoodrell got a reaction from dubnet in MSP430 how to make WS2811Driver reduce from 800 kHz to 400 kHz link inside   
    personally I use the SPI method exclusively for the smart LEDs  (WS2812B, and sk6812 recently)  one trick for getting the timing to cooperate is to set the SPI divider to get you close then you can change the rate of the MCLK registers to fine tune the timing.  it only has to be changed while the SPI is transmitting so you can change the clock back to normal "speed" after your done with the transmission.
  3. Like
    JWoodrell got a reaction from Rickta59 in MSP430 how to make WS2811Driver reduce from 800 kHz to 400 kHz link inside   
    personally I use the SPI method exclusively for the smart LEDs  (WS2812B, and sk6812 recently)  one trick for getting the timing to cooperate is to set the SPI divider to get you close then you can change the rate of the MCLK registers to fine tune the timing.  it only has to be changed while the SPI is transmitting so you can change the clock back to normal "speed" after your done with the transmission.
  4. Like
    JWoodrell got a reaction from gsutton in MSP430G2955 to valueline DIP20 adapter   
    Ii whipped up an adapter to be able to take a G2955 and plug it into a valueline layout DIP20 setup, so it can be a drop in replacement for existing dip20 projects, but take advantage of the larger capability of the G2955.  I extended it out into more of a DIP38 package, but you don't have to put headers on the extended layout and use them only as breakout pins on the board.
     
    I am sending them off to elecrow in blue boards.
     
    I am going to be building mine with flat pins so it can plug into the dip20 sockets, cause those don't like accepting the square "header" pins
     
    [edit] attached the latest files  to the last post[/edit]

  5. Like
    JWoodrell got a reaction from lunakid in Bit-Bang USB on MSP430G2452   
    *poof* version 0.2   with prototype area...  I was actually thinking about that on the way home from work, and was working on it this evening, Just got done remixing the board when you posted.
     
    33mm x 33mm (9 per 10cm x 10cm Board Run)
     
    Layout

     
    Schematic

    usb_0.2.zip
  6. Like
    JWoodrell got a reaction from lunakid in Bit-Bang USB on MSP430G2452   
    Something that might help, if would like to use it.  is the sync code i developed for my USB project (currently stalled in data handling but still moving   It is able to capture the sync signal and align to a single clock pulse to the sync signal and it catches every single one, rather than waiting for one to happen to align.  the theory is based on the fact that a MSP430 will take some random amount of clocks to enter an interrupt look due to the variable instruction length it has to finish.  functionally this can span 7 clock cycles in my testing (15 MHZ clock)  so i built a half-split based delay tree to realign the clock to the longest possible iteration so that my program can run accurate to the USB signal.  after it aligns to the sync is manually bit captures the last 4 bit states to see if it was a valid "sync" byte.  it is built to read D+, but could easily be rebuilt to work from d-.  It is hard to describe exactly how it flows but I will do my best if you are interested. It is hard to describe exactly how it flows but I will do my best if you are interested.  It is also fairly compact code size wise.  It uses the SPI interface to record an 8 bit sample at 1 sample per clock to get a hires picture of a bit transition, then picks out where the transition happened, and aligns to it.  The latest entering iteration drops straight through with minimal delays, and the earlier entering iterations are delays successively longer by 1 cycle until it can handle all 7 iterations
     
    I would like to help however I can.  your initial email is actually what prompted me to teach myself assembly code to try and understand your code.
     
     
    I am still having trouble reading your assembly directly because it is written for a slightly different complier than CCS, but I will help where I can.  the theory should be applicable to your code, albeit it would mean a hybrid of bit bang, and using SPI for the alignment.
     
    Here is the code as it is for CCS assembly (which should be the raw MSP430 commands) the interrupt is called from d+ going high, like yours is
    P1IntSync nop  ;1 cycle delay  mov.b #0x00, R14 ;1 Clear R14 for data check mov.b #0xAA, &UCA0TXBUF ;4  dummy TX write to allow RX capture         bic.b   #0x08,         &P1IE         ;4 disable D+ Interrupt ---//=================================// bic.b   #0x08,         &P1IFG         ;4 reset D+ Interruptflag  // Wait 8 cycles for SPI to record //                              ;  ------------------------//=================================// mov.b &UCA0RXBUF, R15 ;3 copy RX buffer to register AlignStart bit.b #0x08, R15 ;1 Half Split Top or Bottom Half of Byte - Bits 7,6,5,4 / 3,2,1,0 nop ;1 cycle delay jnc BTMA ;2 Jump to Bottom Half Branch - Bits 7,6,5,4 jmp TOPJ1 ;2 2 Cycle Delay for Top Half TOPJ1 jmp TOPJ2 ;2 2 Cycle Delay for Top Half TOPJ2 bit.b #0x08, &P1IN ;4 record data bit for synccheck (X... capture) rlc.b R14 ;1 feed data into synccheck bit.b #0x02, R15 ;1 Half Split for Top Nibble - Bits 3,2 / 1,0 jnc TOPA ;2 Jump to Bits 2 & 3 branch jmp TOPJ3 ;2 2 Cycle Delay TOPJ3 bit.b #0x08, &P1IN ;4 record data bit for synccheck (.X.. capture) rlc.b R14 ;1 feed data into synccheck bit.b #0x01, R15 ;1 Half Split between Bits 0/1 jnc TOPC ;2 Jump around Bit 0 Delay nop ;1 1 Cycle Delay for Bit 0 TOPC jmp AlignDone ;2 Jump to AlignDone exit point TOPA bit.b #0x08, &P1IN ;4 record data bit for synccheck (.X.. capture) rlc.b R14 ;1 feed data into synccheck bit.b #0x04, R15 ;1 Half Split between Bits 3/2 jnc TOPB ;2 Jump around delay for Bit 2 nop ;1 1 Cycle delay for Bit 2 TOPB jmp AlignDone ;2 Jump to AlignDone exit point BTMA bit.b #0x08, &P1IN ;4 record data bit for synccheck (X... capture) rlc.b R14 ;1 feed data into synccheck bit.b #0x20, R15 ;2 jnc BTMB ;2 bit.b #0x08, &P1IN ;4 record data bit for synccheck (.X.. capture) rlc.b R14 ;1 feed data into synccheck bit.b #0x10, R15 ;2 jnc BTMC ;2 nop ;1 BTMC jmp AlignDone ;2 BTMB bit.b #0x08, &P1IN ;4 record data bit for synccheck (.X.. capture) rlc.b R14 ;1 feed data into synccheck nop ;1 nop ;1 nop ;1 jmp AlignDone ;2 AlignDone bit.b #0x08, &P1IN ;4 record data bit for synccheck (..X. capture) rlc.b R14 ;1 feed data into synccheck mov.b #10, &UCA0BR0 ;4 Divider for SMCLK to 10-1 capture for data input bit.b #0x08, &P1IN ;4 record data bit for synccheck (...X capture) rlc.b R14 ;1 feed data into synccheck cmp #0x0B, R14 ;2 Check synccheck pattern (....1011) jne NOJOY ;2 if Bad, call nojoy bic.b #0x20, &P1IFG ;4 reset interrupt flag bis.b #0x01, &IE2 ;4 Enable recieve interrupt reti here is a flow diagram i tried to describe how it branches to delay the signal (block heights set to command execution time)

  7. Like
    JWoodrell got a reaction from tripwire in cutting launchpad for standalone programmer *helpful hint*   
    hey guys I decided to cut down a launchpad to send just the programmer piece to a customer to load a program into a product with.  and i was getting annoyed that the cutboard refused to talk to or download to a processor, while a full launchpad worked just fine.  I knew you could cut the board at the dotted line, so i was frustrated.
     
    after some research it turns out the communication trace going to the RST (and maybe the TST) one as well actually is routed down between the two rows of pins on the 10 pin jtag header between the two sides of the launchpad board...  if you follow the dotted line all the way through and bisect that header, you end up cutting the communications line.  so i soldered some replacement lines in and poof it works fine...
     
    so just a note if you want to cut a launchpad down, cut on the far side of the header retaining all 10 pins, or atleast through the pin holes on the bottom.  Don't follow the dotted line, to make sure you retain the programming lines...
     
    just thought I would share
     

  8. Like
    JWoodrell got a reaction from dubnet in cutting launchpad for standalone programmer *helpful hint*   
    hey guys I decided to cut down a launchpad to send just the programmer piece to a customer to load a program into a product with.  and i was getting annoyed that the cutboard refused to talk to or download to a processor, while a full launchpad worked just fine.  I knew you could cut the board at the dotted line, so i was frustrated.
     
    after some research it turns out the communication trace going to the RST (and maybe the TST) one as well actually is routed down between the two rows of pins on the 10 pin jtag header between the two sides of the launchpad board...  if you follow the dotted line all the way through and bisect that header, you end up cutting the communications line.  so i soldered some replacement lines in and poof it works fine...
     
    so just a note if you want to cut a launchpad down, cut on the far side of the header retaining all 10 pins, or atleast through the pin holes on the bottom.  Don't follow the dotted line, to make sure you retain the programming lines...
     
    just thought I would share
     

  9. Like
    JWoodrell got a reaction from GeekDoc in small solution for detecting 120V AC as a digital input   
    unfortunately i have to detect 16 different lines (these are output verification on a relay control module, so i gotta do 15 copies of this circuit, and don't have the room to implement alot of these suggestions.)
     
    the msp430  talks to an open drain constant current led driver, driving the LEDs inside some SSR relays to switch the AC signal to control the 120v relays on the target piece of equipment)  each of these outputs is what I am sensing and feeding into the sensing optocouplers, all acting as open drains on on a common sensing bus, so when i put it through self test, it turns each one on and off seperately looking for that sense buss to be pulled low.
     
     
    here is what the board layout looks right now (with the capacitor driven optos) looks like
     
    for those playing at home...
    the LED driver is a Texas Instrument TLC5926
    the SSRs are Panasonic AQH3213A
    the Optocouplers are Lite-On LTV-814HS, and LTV-844HS  (single, and 4 channel units)
    and the 3.6v regulator is a Texas Instrument TPS54336 switcher
     
    this PCB actually serves 3 functions.  the wall mounted box has this board to drive the primary 15 relays, if I cut along the 120v line, and mount a second version via standoffs with the JP points and close the solder jumper on the back, it will act as a second relay board with its LED driver serial input coming from the output of the main LED driver, so it is a second set of 15 relays as an optional expansion for them.  neither of these have the MSP430 mounted on them though, the hand held box has this board in the base with the MSP430 mounted and none of the 120v stuff populated, and going out the PB_IO header, and the OLED_IO header to the frint panel of the handheld unit to the switch board that has the user push buttons and OLED on it for the interface, so this same PCB has 3 different jobs built into it.

  10. Like
    JWoodrell got a reaction from GeekDoc in small solution for detecting 120V AC as a digital input   
    that is something to say towards the opto then, because worst case is the capacitor would fail shorted and would cause the optos LEDs to blow and wouldn't take out anything else cause the output side is still isolated.
  11. Like
    JWoodrell got a reaction from GeekDoc in atx power box   
    well I needed a full 24v supply to test my project here (only 300 mA)
     
    and i thought hey i can snag the 12V and -12V rail from my workhorse ATX supply i have,  but then i thought this morning, HEY i got that Dangerous prototypes ATX breakout board as a prize on the forum here a while back although at this point i don't remember for what.
     
    so i was off to the races, resoldering and reworking the dc half of the ATX supply board to clean up the wan-hung lo construction and massive blobs of solder all over everything...  anyway it now only has a single line from each rail to the pin on the breakout board rather than the 6 to 8 wires per rail for the computer like it used to have, much cleaner and better airflow.
     
    anyway stuffed it in a spare 4"x6"x2" project box i had left over, with just alittle encouragement two of the mounting holes for the atx pcb mounted to the mounting bosses in the box, so its actually screwed down nicely.  used the stock plastic isolator sheet that used to isolate the pcb from the metal atx frame to isolate the atx breakout from the high voltage stuff, as well as directing air flow around in the case.
     
    works pretty well, and not as large as I thought it would end up being when i started.
     
    I like how it turned out

     
    you can see the LEDs shining through the label for each rail.

     
    the guts from my atx, and the breakout board.

  12. Like
    JWoodrell reacted to rockets4kids in small solution for detecting 120V AC as a digital input   
    You might also want to check out this app note from Microchip on transformer-less power supplies:
     
    ww1.microchip.com/downloads/en/.../00954A.pdf
     
    You could use one of these to drive an opto-isolator if you want a steady-state signal.
  13. Like
    JWoodrell got a reaction from spirilis in small solution for detecting 120V AC as a digital input   
    that is something to say towards the opto then, because worst case is the capacitor would fail shorted and would cause the optos LEDs to blow and wouldn't take out anything else cause the output side is still isolated.
  14. Like
    JWoodrell got a reaction from bluehash in atx power box   
    well I needed a full 24v supply to test my project here (only 300 mA)
     
    and i thought hey i can snag the 12V and -12V rail from my workhorse ATX supply i have,  but then i thought this morning, HEY i got that Dangerous prototypes ATX breakout board as a prize on the forum here a while back although at this point i don't remember for what.
     
    so i was off to the races, resoldering and reworking the dc half of the ATX supply board to clean up the wan-hung lo construction and massive blobs of solder all over everything...  anyway it now only has a single line from each rail to the pin on the breakout board rather than the 6 to 8 wires per rail for the computer like it used to have, much cleaner and better airflow.
     
    anyway stuffed it in a spare 4"x6"x2" project box i had left over, with just alittle encouragement two of the mounting holes for the atx pcb mounted to the mounting bosses in the box, so its actually screwed down nicely.  used the stock plastic isolator sheet that used to isolate the pcb from the metal atx frame to isolate the atx breakout from the high voltage stuff, as well as directing air flow around in the case.
     
    works pretty well, and not as large as I thought it would end up being when i started.
     
    I like how it turned out

     
    you can see the LEDs shining through the label for each rail.

     
    the guts from my atx, and the breakout board.

  15. Like
    JWoodrell got a reaction from dubnet in atx power box   
    well I needed a full 24v supply to test my project here (only 300 mA)
     
    and i thought hey i can snag the 12V and -12V rail from my workhorse ATX supply i have,  but then i thought this morning, HEY i got that Dangerous prototypes ATX breakout board as a prize on the forum here a while back although at this point i don't remember for what.
     
    so i was off to the races, resoldering and reworking the dc half of the ATX supply board to clean up the wan-hung lo construction and massive blobs of solder all over everything...  anyway it now only has a single line from each rail to the pin on the breakout board rather than the 6 to 8 wires per rail for the computer like it used to have, much cleaner and better airflow.
     
    anyway stuffed it in a spare 4"x6"x2" project box i had left over, with just alittle encouragement two of the mounting holes for the atx pcb mounted to the mounting bosses in the box, so its actually screwed down nicely.  used the stock plastic isolator sheet that used to isolate the pcb from the metal atx frame to isolate the atx breakout from the high voltage stuff, as well as directing air flow around in the case.
     
    works pretty well, and not as large as I thought it would end up being when i started.
     
    I like how it turned out

     
    you can see the LEDs shining through the label for each rail.

     
    the guts from my atx, and the breakout board.

  16. Like
    JWoodrell reacted to RobG in WS2812B LEDs   
    WS2812D, an 8mm RGB LED with integrated WS2811, will be available in my store next week.
     
     
     

  17. Like
    JWoodrell reacted to tripwire in checking a character string in a buffer   
    If Line is an array of char, then the reason this won't work is a bit more subtle than that.
     
    C and C++ don't support equality comparison of native arrays. That means that (Line == "[start config]") doesn't compare each element of Line with the corresponding elements of the "[start config]" string literal. Instead, Line and "[start config]" both decay to pointers to their first elements. Then the values of those pointers are compared. The two arrays are at different locations in memory, so the two pointers will never match.
  18. Like
    JWoodrell reacted to pabigot in checking a character string in a buffer   
    #include <string.h> int strcmp(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t n); Assuming your toolchain has a proper libc. 
    (edit) In case you don't have man pages: the return value is negative if s1 is lexicographically less than s2, positive if it's greater, zero if they're equal.
  19. Like
    JWoodrell got a reaction from xpg in [POTM] Audible Alarm player.   
    well, here is what has gone on with this project so far.
     
    here are the test units actually mounted to the equipment at the factory.


     
    had to cut the boxes speaker grills by hand with a dremel but it came out well for the 4 test units, the 100 will be cnc routed and all nice and spiffy.

    the 4 test units worked well for them and now they have ordered 100 units of one type and 15 of another i need to redesign slightly
    here are the test boards assembled


    I had to split the circuit board on one of the two versions because the speaker interfered with the heatsink, and I had planned on the smaller speaker when designing these initial test boards.
     
    I got a cubic butt ton of parts sitting in my room right now waiting to be sent to the assembler.
    120 SD cards

    enough parts to build 120 units

     
    There are now 3 speaker versions of this project, one up to 87 dB, one up to about 100dB, and the third around 110, and I'm working on a fourth to take it up to about 120ish i hope but well see.
     
    Figured out the LDO overheating problem I was having and why I had to have a sizeable heatsink to-220 package for the 24V to 3.6v regulator.  the sd card slot has a card detect switch, and although neither pin on the switch is connected to the case (ground), when it is soldered down, and a card is inserted there is about 17 ohms resistance to ground.  I had the switch wired as positive switching. im not sure why, and don't really care to figure out the fine details, needless to say this was pulling about 300 mA from the regulator and dropping from 24 down to 3.6v, was dissipating about 6 watts hence roasted sot23. so i am changing to an open drain setup where the switch will ground the line, and it will have a pullup resistor...  anyway problem found.
     
    have coding changes in place to read 16bit files, as well as stereo.  (so either every other data is valid, or one out of four, it just ignores the other samples) fine tuned the timing and sampling so quality is basically full now, I would say CD quality but I;m a bad judge of audio.  it can do 44 k samples/sec files without dropping any samples and no  static or glitches that I can hear.
     
    anyway I am going to let you know how it goes from here
  20. Like
    JWoodrell got a reaction from bluehash in [POTM] Audible Alarm player.   
    well, here is what has gone on with this project so far.
     
    here are the test units actually mounted to the equipment at the factory.


     
    had to cut the boxes speaker grills by hand with a dremel but it came out well for the 4 test units, the 100 will be cnc routed and all nice and spiffy.

    the 4 test units worked well for them and now they have ordered 100 units of one type and 15 of another i need to redesign slightly
    here are the test boards assembled


    I had to split the circuit board on one of the two versions because the speaker interfered with the heatsink, and I had planned on the smaller speaker when designing these initial test boards.
     
    I got a cubic butt ton of parts sitting in my room right now waiting to be sent to the assembler.
    120 SD cards

    enough parts to build 120 units

     
    There are now 3 speaker versions of this project, one up to 87 dB, one up to about 100dB, and the third around 110, and I'm working on a fourth to take it up to about 120ish i hope but well see.
     
    Figured out the LDO overheating problem I was having and why I had to have a sizeable heatsink to-220 package for the 24V to 3.6v regulator.  the sd card slot has a card detect switch, and although neither pin on the switch is connected to the case (ground), when it is soldered down, and a card is inserted there is about 17 ohms resistance to ground.  I had the switch wired as positive switching. im not sure why, and don't really care to figure out the fine details, needless to say this was pulling about 300 mA from the regulator and dropping from 24 down to 3.6v, was dissipating about 6 watts hence roasted sot23. so i am changing to an open drain setup where the switch will ground the line, and it will have a pullup resistor...  anyway problem found.
     
    have coding changes in place to read 16bit files, as well as stereo.  (so either every other data is valid, or one out of four, it just ignores the other samples) fine tuned the timing and sampling so quality is basically full now, I would say CD quality but I;m a bad judge of audio.  it can do 44 k samples/sec files without dropping any samples and no  static or glitches that I can hear.
     
    anyway I am going to let you know how it goes from here
  21. Like
    JWoodrell got a reaction from Rickta59 in [POTM] Audible Alarm player.   
    well, here is what has gone on with this project so far.
     
    here are the test units actually mounted to the equipment at the factory.


     
    had to cut the boxes speaker grills by hand with a dremel but it came out well for the 4 test units, the 100 will be cnc routed and all nice and spiffy.

    the 4 test units worked well for them and now they have ordered 100 units of one type and 15 of another i need to redesign slightly
    here are the test boards assembled


    I had to split the circuit board on one of the two versions because the speaker interfered with the heatsink, and I had planned on the smaller speaker when designing these initial test boards.
     
    I got a cubic butt ton of parts sitting in my room right now waiting to be sent to the assembler.
    120 SD cards

    enough parts to build 120 units

     
    There are now 3 speaker versions of this project, one up to 87 dB, one up to about 100dB, and the third around 110, and I'm working on a fourth to take it up to about 120ish i hope but well see.
     
    Figured out the LDO overheating problem I was having and why I had to have a sizeable heatsink to-220 package for the 24V to 3.6v regulator.  the sd card slot has a card detect switch, and although neither pin on the switch is connected to the case (ground), when it is soldered down, and a card is inserted there is about 17 ohms resistance to ground.  I had the switch wired as positive switching. im not sure why, and don't really care to figure out the fine details, needless to say this was pulling about 300 mA from the regulator and dropping from 24 down to 3.6v, was dissipating about 6 watts hence roasted sot23. so i am changing to an open drain setup where the switch will ground the line, and it will have a pullup resistor...  anyway problem found.
     
    have coding changes in place to read 16bit files, as well as stereo.  (so either every other data is valid, or one out of four, it just ignores the other samples) fine tuned the timing and sampling so quality is basically full now, I would say CD quality but I;m a bad judge of audio.  it can do 44 k samples/sec files without dropping any samples and no  static or glitches that I can hear.
     
    anyway I am going to let you know how it goes from here
  22. Like
    JWoodrell got a reaction from RobG in [POTM] Audible Alarm player.   
    well, here is what has gone on with this project so far.
     
    here are the test units actually mounted to the equipment at the factory.


     
    had to cut the boxes speaker grills by hand with a dremel but it came out well for the 4 test units, the 100 will be cnc routed and all nice and spiffy.

    the 4 test units worked well for them and now they have ordered 100 units of one type and 15 of another i need to redesign slightly
    here are the test boards assembled


    I had to split the circuit board on one of the two versions because the speaker interfered with the heatsink, and I had planned on the smaller speaker when designing these initial test boards.
     
    I got a cubic butt ton of parts sitting in my room right now waiting to be sent to the assembler.
    120 SD cards

    enough parts to build 120 units

     
    There are now 3 speaker versions of this project, one up to 87 dB, one up to about 100dB, and the third around 110, and I'm working on a fourth to take it up to about 120ish i hope but well see.
     
    Figured out the LDO overheating problem I was having and why I had to have a sizeable heatsink to-220 package for the 24V to 3.6v regulator.  the sd card slot has a card detect switch, and although neither pin on the switch is connected to the case (ground), when it is soldered down, and a card is inserted there is about 17 ohms resistance to ground.  I had the switch wired as positive switching. im not sure why, and don't really care to figure out the fine details, needless to say this was pulling about 300 mA from the regulator and dropping from 24 down to 3.6v, was dissipating about 6 watts hence roasted sot23. so i am changing to an open drain setup where the switch will ground the line, and it will have a pullup resistor...  anyway problem found.
     
    have coding changes in place to read 16bit files, as well as stereo.  (so either every other data is valid, or one out of four, it just ignores the other samples) fine tuned the timing and sampling so quality is basically full now, I would say CD quality but I;m a bad judge of audio.  it can do 44 k samples/sec files without dropping any samples and no  static or glitches that I can hear.
     
    anyway I am going to let you know how it goes from here
  23. Like
    JWoodrell got a reaction from RobG in [POTM] Audible Alarm player.   
    Well got the thing soldered and finalized and shipped out to the customer today (so sorry no video of it playing hiphop chicken)  but here are pictures of the final "Prototype build"
     
    it ended up with 3 possible sounds (2 input as a binary, 10, 01, 11 setup) hopefully they will accept the design and I'll get to make the production version.





  24. Like
    JWoodrell got a reaction from RobG in [POTM] Audible Alarm player.   
    hey guys I'm throwing my project on here I am finishing up.
     
    It is an audible alarm player I am building for the company my dad works for.  to put on some of their equipment there.
     
    [VIDEO]
     
    the requirements were there are 2 signal wires at +24 volts and a common wire.  It had to power up and play one of two different sounds (they didn;t specify the sounds, but described it as wanting a "bongie bong" type of sound.)  oh and it had to be able to achieve 85 decibels in loudness.
     
    this is what I had to work with.  talking to my dad i convinced him to let me make it with a microcontroller playing a wave file from an SD card (even though I didn't know exactly how to do that yet)
     
    so I was off to the races, looking through various sound playing, and sd card reading projects to figure it out.
     
    I settled on the Petit FatFS based "SD Card Booster Pack" that Bluehash put together as a good base to start from.
     
    Originally used a PWM based output to the amplifier to generate sound but the quality was basically junk, you could tell what was being played but barely.
     
    I decided to switch over to a R2R based DAC circuit to generate actually voltage outputs.  to keep it simple I made it an 8 bit DAC being driven by the entire P2 bank of I/O.  I just write an 8 bit value to "P2OUT" and I get an analog voltage out the other end automatically so it keeps things simple.
     
    This worked pretty well but I had card reading issues in that it would play a segment then read a new segment (no sound output) then play that new segment.  no good.   So I researched how the buffer might work in RickTA59's sound project as well as how to stream data byte by byte and wrote my own FIFO buffer based on those ideas.
     
    this got me 90% of the way there sound quality was good, but there was static and other glitches still being heard.
     
    my next trick was multi sampling the wav file to improve on the 8kHz sample rate.  so since the processor had alot of extra time twiddling its thumbs between samples, I put it to work,  I bumped up the timer ISR rate by 4 times, and only pulled a new "sample" from the wav file once every 4 ISR cycles.  but had the processor generated an interpolated point in between those two values in the remaining 3 ISR cycles, so now it is producing a new "sample output" at 32kHz from an 8kHz file, this helped alot as well.  and playing with a few filter caps for the R2R ladder pre volume pot and a low pass filter at the audio amplifier input got me the rest of the way there.  now I am very happy with the sound quality.
     
    so there is the work in progress on this thing so far, I just have to solder the amplifier into the protoboard instead of having it bread boarded.  and mount everything in its enclosure for them.
     
    it works with Fat32 perfectly well so its just popping the card into your computer, and dropping a file onto it
     
    the next challenge is if they approve of the design, i get to make 100 units of this for them by Christmas ish to early january
     
     
    oh and if you enable "use print" then it will spit diagnostic information out the serial port to read in termite or whatever console you wanna read it in.
     
    here is the code, and the eagle file that is the planned production PCB so far (may well be changed before its made)
    JWoodrell_Audible_Alarm.zip
    audio_board_single_supply-v2.zip
  25. Like
    JWoodrell got a reaction from Rickta59 in [ ENDED ] Nov 2013 - Jan 2014 - 43oh Project of the Month Contest   
    I'm going to throw my project on here.
     
    It is a SD card based audible alarm player. *now with sound quality*
     
    the user provides a 24v signal on one of two input wires, and the unit takes that 24v power and uses it to power up the MSP430 and amplifier.  It reads the file linked to that input signal and plays it out the speaker.  I did a couple of tricks to improve sound quality.  right now it is working best with 8kHz 8 bit wav files, but it adapts to other sample rates on the fly.  right now it doesn't understand how to read 16 bit files, but this is just the first draft, and that is in the planning.
     
    http://www.youtube.com/watch?v=wJ-gWZK3wAQ
×
×
  • Create New...