This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2553: Output square wave for haptic driver

Part Number: MSP430G2553
Other Parts Discussed in Thread: DRV8662EVM

Hello,

Hope you're well. I'm currently updating the output waveform using CCS for the DRV8662EVM, but I was wondering whether there's a way to output square waves? In the source code for this driver, there's sine.h file and triangle.h file, but is the a square wave version?

Thank you for your help.

Best Regards,

Kate

  • Hi Kate,

    I downloaded the source code and found the two waveform files, 'sine1024.h' and 'triangle1024.h'. The waveforms in these two files are constructed manually in an array.

    I took the data in the 'triangle1024.h' file, removed the "0x" portion of each byte, and imported it into Excel to plot the waveform. I've attached the files below and the graph for your reference.

    triangle1024.h

    triangle1024_waveform_data_converted_for_importing_into_excel.txt
    80,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,8A,8A,8B,8B,8C,8C,8D,8D,8E,8E,8F,8F,90,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,99,9A,9A,9B,9B,9C,9C,9D,9D,9E,9E,9F,9F,A0,A0,A1,A1,A2,A2,A3,A3,A4,A4,A5,A5,A6,A6,A7,A7,A8,A8,A9,A9,AA,AA,AB,AB,AC,AC,AD,AD,AE,AE,AF,AF,B0,B0,B1,B1,B2,B2,B3,B3,B4,B4,B5,B5,B6,B6,B7,B7,B8,B8,B9,B9,BA,BA,BB,BB,BC,BC,BD,BD,BE,BE,BF,BF,C0,C0,C1,C1,C2,C2,C3,C3,C4,C4,C5,C5,C6,C6,C7,C7,C8,C8,C9,C9,CA,CA,CB,CB,CC,CC,CD,CD,CE,CE,CF,CF,D0,D0,D1,D1,D2,D2,D3,D3,D4,D4,D5,D5,D6,D6,D7,D7,D8,D8,D9,D9,DA,DA,DB,DB,DC,DC,DD,DD,DE,DE,DF,DF,E0,E0,E1,E1,E2,E2,E3,E3,E4,E4,E5,E5,E6,E6,E7,E7,E8,E8,E9,E9,EA,EA,EB,EB,EC,EC,ED,ED,EE,EE,EF,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,57,56,56,55,55,54,54,53,53,52,52,51,51,50,50,4F,4F,4E,4E,4D,4D,4C,4C,4B,4B,4A,4A,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42,42,41,41,40,40,3F,3F,3E,3E,3D,3D,3C,3C,3B,3B,3A,3A,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,2F,2F,2E,2E,2D,2D,2C,2C,2B,2B,2A,2A,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,1F,1F,1E,1E,1D,1D,1C,1C,1B,1B,1A,1A,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,0F,0F,0E,0E,0D,0D,0C,0C,0B,0B,0A,0A,09,09,08,08,07,07,06,06,05,05,04,04,03,03,02,02,01,01,00,00,00,01,01,02,02,03,03,04,04,05,05,06,06,07,07,08,08,09,09,0A,0A,0B,0B,0C,0C,0D,0D,0E,0E,0F,0F,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,1A,1A,1B,1B,1C,1C,1D,1D,1E,1E,1F,1F,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,2A,2A,2B,2B,2C,2C,2D,2D,2E,2E,2F,2F,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,3A,3A,3B,3B,3C,3C,3D,3D,3E,3E,3F,3F,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,4A,4A,4B,4B,4C,4C,4D,4D,4E,4E,4F,4F,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,5A,5A,5B,5B,5C,5C,5D,5D,5E,5E,5F,5F,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,6A,6A,6B,6B,6C,6C,6D,6D,6E,6E,6F,6F,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,7A,7A,7B,7B,7C,7C,7D,7D,7E,7E,7F,7F

    DRV.xlsx

    To generate a square wave version, I would recommend that you create a new .h file, such as 'square1024.h', and fill the array using two (binary) values: 0x00 for 0, 0xFF for 1. Obviously, the period and pulse-width will depend on how many consecutive 0's and 1's.

    Does this make sense?

    Regards,

    James

    MSP Customer Applications

  • Hi James,

    Yes, it makes sense and I'll try that out today. Thank you so much for your help!

    Best Regards,

    Kate

**Attention** This is a public forum