Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LG by
Diff: Dither_Reg.c
- Revision:
- 214:4c70e452c491
- Parent:
- 197:7a05523bf588
diff -r 9953db9543d6 -r 4c70e452c491 Dither_Reg.c --- a/Dither_Reg.c Wed Jul 26 13:24:39 2017 +0000 +++ b/Dither_Reg.c Wed Aug 16 09:00:25 2017 +0000 @@ -333,7 +333,7 @@ //заданный период ошумления // Tnoise = add( Device_blk.Str.VBN_Tzd, mult_r(Device_blk.Str.VBN_Ran, rand())); // Tnoise = Device_blk.Str.VBN_Tzd + MULT_RND_SAT( Device_blk.Str.VBN_Ran, rand() ); if ( Flag ) { //e. calculation +dF/-dF //r. расчет +dF/-dF - // temp = Device_blk.Str.VBN_k; //r. 25 - заданная константа ошумления + temp = Device_blk.Str.VBN_k; //r. 25 - заданная константа ошумления } else { // temp = -Device_blk.Str.VBN_k; } @@ -357,12 +357,14 @@ ******************************************************************************/ void VibroDither_Init() { + + LPC_SC->PCONP |= 0x00020000; //включение ШИМ. LPC_SC->PCLKSEL1 |= 0xC0000000; //CLK=12.5MHz выбор частоты /* P1.25,1.26 as PhA_vibro; P1.28,1.29 as PhB_vibro*///выбор ножек для двух (трех) каналов ШИМ(PhA и PhB). // LPC_PINCON->PINSEL3 &= ~(0x3CF<<18); -// LPC_PINCON->PINSEL3 |= (0x145 << 18) |(1<<6)|(1<<12);//P1.19 - MCOA0; P1.22 - MCOB0; P1.25 - MCOA1; P1.26 - MCOB1; P1.28 - MCOA2; P1.29 - MCOB2; + ///LPC_PINCON->PINSEL3 |= (0x145 << 18) |(1<<6)|(1<<12);//P1.19 - MCOA0; P1.22 - MCOB0; P1.25 - MCOA1; P1.26 - MCOB1; P1.28 - MCOA2; P1.29 - MCOB2; //выходы ШИМ (MCOA и MCOB) разной полярности. LPC_MCPWM->CON_SET |= 1<<30; //e. set AC mode (Pha, PhB periods are set by LIM0 )