Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F1936 variable duty cycle with lookup table and potentiometer

Status
Not open for further replies.
so could you help using another methods of LUT storage??

Thank you!!
 

Hi,

in post#5 there is the suggestion for using ROM. What´s wrong with that?

You already read other threads about sine wave generation. Sometimes there is the complete code, sometimes with explanations and examples on how to implement it.
Why can´t you use it for your application?

Klaus
 

but the proble is that I don`t know to address the data memory so that I can use the

RETLW (Values)

please help if you know how I can proceed,

Thank you
 

Hi,

I´m not familiar with PIC. So I just googled for "PIC lookup table". Now i have a couple of different solutions how to implement it. With good explanations. Within one minute.
You can do the same.

Just pick one of the given solutions and transfer it to your program.

Klaus
 

Hi,

as said I´m not familiar, but reading the lookup table solutions i didn´f find an information that this is not possible with PIC16F1936.

For one solution you just need two instructions:
* addwf and retlw.
Is one or both NOT available on PIC16F1936?

If both instructions are available, then tell me why the solution is not possible with your PIC.

microchip AN556 says it is possible with PIC16Fxxxx.

Klaus
 

I got such codes but the PIC are not the same so I want to adapt the codes to my PIC16f1936,for example the https://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en012129 Here are the codes but I need a help for adapting them to my PIC16F1936,here they used PIC16F777,

Please help!!
In general, the assembler language for all members of a family are the same. Therefore code is transportable between them.
What does change between devices are the available peripherals, the sizes of RAM and ROM and (sometimes) the locations of the SFRs. However, the templates and proper practices described by Microchip always start with the inclusion of a file that defines the hardware register locations etc. (often via a files that uses a command-line parameter so the device selection is made in the IDE) which means that even this aspect is largely transparent.
This applies to assembler as well as C.
I suggest that you use the code as written and look to see what "magic numbers" are defined, typically at the start of the source file and make sure they fit your requirements. These might be such things as processor speeds, clock sources and the like. Then run the code through the assembler and see what error messages come out - of course starting with the first one (and ignore the subsequent ones as they might be consequential on the first) - and sort them out in turn.
Susan
 

On board EEPROM on the PIC16 can be read very quickly but PIC18F or ones with the enhanced instruction set are better because they have 'table read and increment address' instructions that save having to load the address each time. Even on 16F, if the table does not cross a page boundary (which it doesn't in this case) it can read one byte and advance the address in as little as 20 clock cycles. (1 million reads per second at 20MHz).

Jean12, please try what I suggested with the code template, it makes life much easier when the 'skeleton' of code is already written for you. It will also explain why you have a lot of un-needed instructions such as
Code:
W_TEMP        RES    1    ;LOCATION FOR SAVING 'WREG' DURING INTERRUPT
STATUS_TEMP    RES    1    ;LOCATION FOR SAVING 'STATUS' DURING INTERRUPT
and why "CNT15 EQU h'25'" is wrong.

Brian.
 

Hopefully,like this I come out by fixing all my codes,dear betwixt,I have now implemented the EEPROM reading but the system is jumping some address I am asking myself why?for

CNT15 EQU h'25' I removed it now I am reading the remaining is to combine reading EEPROM and use Potentiometer in order to allow ADC to act on the duty cycle,
 

Hello,here are my codes giving three variable PWM signals on CCP1CCP2 and CCP3 of PIC16F1936,but could anyone help me to implement a phase shift of 120 degrees and also configure the frequency of operation between 0-35Hz,please help.

PHP:
	LIST P=P16F1936
	#include <P16F1936.INC>


	ERRORLEVEL  -302 ;Warning destination register
	ERRORLEVEL  -207 ;Warning label after column 1



	__CONFIG H'8007',H'3FAA'
	__CONFIG H'8008',H'3FBC'
;	UDATA_SHR	

	;///////////////////////////////////////////////////////////////
	;PROGRAM ASSIGNATIONS
	;///////////////////////////////////////////////////////////////
	;CNT15 EQU h'25'


LOCALES	UDATA 0X20

FLAGS		RES	1	;FLAGS REGISTERS USED TO INDICATE DIFFERENT STATUS
tmp1        RES 1
tmp2        RES 1



GLOBALES UDATA_SHR;Starting of zone 0x71 to 0x7F
	W_TEMP		RES	1	;LOCATION FOR SAVING 'WREG' DURING INTERRUPT
   STATUS_TEMP	RES	1	;LOCATION FOR SAVING 'STATUS' DURING INTERRUPT
CNT15       RES 1
CNT16       RES 1
CNT17       RES 1

	ORG 0XF000
			DE D'123'
			DE D'127'
			DE D'129'
			DE D'133'
			DE D'135'
			DE D'139'
			DE D'141'
			DE D'145'
			DE D'146'
			DE D'150'
			DE D'152'
			DE D'156'
			DE D'158'
			DE D'162'
			DE D'164'
			DE D'167'
			DE D'169'
			DE D'173'
			DE D'174'
			DE D'177'
			DE D'179'
			DE D'182'
			DE D'184'
			DE D'187'
			DE D'189'
			DE D'192'
			DE D'194'
			DE D'197'
			DE D'198'
			DE D'201'
			DE D'203'
			DE D'205'
			DE D'207'
			DE D'209'
			DE D'210'
			DE D'213'
			DE D'214'
			DE D'216'
			DE D'218'
			DE D'219'
			DE D'221'
			DE D'222'
			DE D'223'
			DE D'225'
			DE D'226'
			DE D'227'
			DE D'228'
			DE D'229'
			DE D'230'
			DE D'231'
			DE D'231'
			DE D'233'
			DE D'233'
			DE D'234'
			DE D'234'
			DE D'235'
			DE D'235'
			DE D'235'
			DE D'236'
			DE D'236'
			DE D'236'
			DE D'236'
			DE D'236'
			DE D'235'
			DE D'235'
			DE D'235'
			DE D'234'
			DE D'233'
			DE D'233'
			DE D'232'
			DE D'231'
			DE D'231'
			DE D'230'
			DE D'229'
			DE D'228'
			DE D'227'
			DE D'226'
			DE D'224'
			DE D'223'
			DE D'222'
			DE D'221'
			DE D'218'
			DE D'218'
			DE D'215'
			DE D'214'
			DE D'212'
			DE D'210'
			DE D'208'
			DE D'207'
			DE D'204'
			DE D'203'
			DE D'200'
			DE D'198'
			DE D'195'
			DE D'194'
			DE D'191'
			DE D'189'
			DE D'186'
			DE D'184'
			DE D'181'
			DE D'179'
			DE D'176'
			DE D'174'
			DE D'171'
			DE D'169'
			DE D'165'
			DE D'164'
			DE D'159'
			DE D'158'
			DE D'154'
			DE D'152'
			DE D'148'
			DE D'146'
			DE D'142'
			DE D'141'
			DE D'137'
			DE D'135'
			DE D'131'
			DE D'129'
			DE D'125'
			DE D'123'
			
;POWER ON RESET VECTOR LOCATION
;**************************************************************************************
STARTUP	CODE	0X0000			;RESET VECTOR ADDRESS 
		GOTO	START				
	CODE	0X04			;INTERRUPT VECTOR LOCATION
		GOTO	readadc	     	;GOTO INTERRUPT SERVICE ROUTINE

;**************************************************************************************
;PROG0	CODE 
;**************************************************************************************
;INITIALIZATION OF THE PORTS AND TIMERS
START

		BANKSEL	WDTCON
 		CLRF	WDTCON		
		MOVLW 0x0F
		BANKSEL TRISA
		MOVWF TRISA

		BANKSEL PORTB
		CLRF PORTB
		BANKSEL TRISB
		MOVLW 0xB7
		MOVWF TRISB
		BANKSEL T2CON
		CLRF T2CON		
		MOVLW	0X0C
		BANKSEL CCP1CON	
		MOVWF CCP1CON
		BANKSEL CCP2CON
		MOVWF CCP2CON
		BANKSEL CCP3CON
		MOVWF CCP3CON

        BANKSEL	PR2
		MOVLW	d'74'		;LOAD PR2 VALUE TO PR2 REGISTER  For 10KHZ generated signal
		MOVWF	PR2			
		MOVLW 0XFF
		BANKSEL APFCON
		MOVWF APFCON
		MOVLW 0x10
		BANKSEL PWM1CON
		MOVWF PWM1CON
		BANKSEL PWM2CON
		MOVWF PWM2CON
		BANKSEL PWM3CON
		MOVWF PWM3CON

		MOVLW 0X0F
		BANKSEL CCP1AS
		MOVWF CCP1AS
		BANKSEL CCP2AS
		MOVWF CCP2AS
		BANKSEL CCP3AS
		MOVWF CCP3AS
		MOVLW 0X1F
		BANKSEL PSTR1CON
		MOVWF PSTR1CON
		BANKSEL PSTR2CON
		MOVWF PSTR2CON
		BANKSEL PSTR3CON
		MOVWF PSTR3CON
	
		MOVLW 0x00
		BANKSEL CCPTMRS0
		MOVWF CCPTMRS0
		BANKSEL TRISC
		BCF TRISC,2
		BANKSEL TRISB
		BCF TRISB,3
		BCF TRISB,6
		BANKSEL T2CON
		MOVLW 0x05
		MOVWF T2CON	

		;BANKSEL CCPR1L		
		;CLRF CCPR1L	
		;BANKSEL CCPR2L
		;CLRF CCPR2L
		;BANKSEL CCPR3L
		;CLRF CCPR3L
		;BANKSEL EEDATL
		;CLRF EEDATL	
		;BANKSEL EECON1
		;BCF EECON1,RD
	;	CALL 
;///////////////////////////////////////////////////////////////////////////////////////
;						PROGRAMME PRINCIPAL
;///////////////////////////////////////////////////////////////////////////////////////
		MOVLW d'121'
		MOVWF CNT15  
PROG

	DECFSZ CNT15,F
	GOTO next
	RETURN
	;nop
next
	MOVF CNT15,W
	BANKSEL EEADRL ;Switch to Bank1
	MOVWF EEADRL ;Put counter to EEADR
	BANKSEL EECON1
	BCF EECON1,CFGS
	BCF EECON1,EEPGD
	BSF EECON1,RD
	BANKSEL EEDATL
	MOVF EEDATL,W
	DECF CNT15,1
adcplace
	CALL readadc
	BANKSEL ADRESH
	MOVF ADRESH,W
	BANKSEL CCPR1L
	MOVWF CCPR1L
	BANKSEL CCPR2L
	MOVWF CCPR2L
	BANKSEL CCPR3L
	MOVWF CCPR3L
	BANKSEL EEDATL
	MOVF EEDATL,W
	BANKSEL CCPR1L	
	MOVWF CCPR1L
	CALL UPDATE_SPWM2
	CALL UPDATE_SPWM3
	GOTO PROG
	RETURN

UPDATE_SPWM2

	MOVLW D'121'
	MOVWF CNT15	
next2
	DECFSZ CNT15,f
	GOTO next21
	RETURN
next21
	MOVF CNT15,W
	BANKSEL EEADRL ;Switch to Bank1
	MOVWF EEADRL ;Put counter to EEADR
	BANKSEL EECON1
	BCF EECON1,CFGS
	BCF EECON1,EEPGD
	BSF EECON1,RD
	BANKSEL EEDATL
	MOVF EEDATL,W
	DECF CNT15,1
adcplace2
;	CALL readadc
	;BANKSEL ADRESH
	;MOVF ADRESH,W
	;BANKSEL CCPR2L
	;MOVWF CCPR2L
	BANKSEL EEDATL
	MOVF EEDATL,W
	BANKSEL CCPR2L	
	MOVWF CCPR2L
	;call delay_1us
	RETURN

UPDATE_SPWM3
	MOVLW D'121'
	MOVWF CNT15	
next3
	DECFSZ CNT15,f
	GOTO next31
	RETURN
next31
	MOVF CNT15,W
	BANKSEL EEADRL ;Switch to Bank1
	MOVWF EEADRL ;Put counter to EEADR
	BANKSEL EECON1
	BCF EECON1,CFGS
	BCF EECON1,EEPGD
	BSF EECON1,RD
	BANKSEL EEDATL
	MOVF EEDATL,W
	DECF CNT15,1
adcplace3
	CALL readadc
	BANKSEL ADRESH
	MOVF ADRESH,W
	BANKSEL CCPR3L
	MOVWF CCPR3L
	BANKSEL EEDATL
	MOVF EEDATL,W
	BANKSEL CCPR3L	
	MOVWF CCPR3L
	;call delay_1us
	RETURN
readadc  
		BSF PIE1,ADIE
	 	BSF INTCON,GIE
		BSF INTCON,PEIE
		BTFSS PIE1,ADIE
		return
		BTFSS PIR1,ADIF
		RETURN		
		CALL bosco
		BCF PIR1,ADIF
		return
bosco
		BANKSEL ANSELA
		MOVLW 0X01
		MOVWF ANSELA
		MOVLW 0x01
		BANKSEL ADCON0
		MOVWF ADCON0
		MOVLW 0x20
		BANKSEL ADCON1
		MOVWF ADCON1		
		BANKSEL ADCON0
		BSF ADCON0,GO
		BSF ADCON0,CHS0
		call delay1
		BANKSEL ADRESH	
	    MOVF ADRESH,W
		BANKSEL CCPR1L
		MOVWF CCPR1L
		BANKSEL CCPR2L
		MOVWF CCPR2L
		BANKSEL CCPR3L
		MOVWF CCPR3L
		return		
readvoltage
		MOVLW 0X20
		BANKSEL ADCON1
		MOVWF ADCON1
		MOVLW 0X02
		BANKSEL ADCON0
		MOVWF ADCON0		
		BSF ADCON0,CHS0
		BCF ADCON1,CHS1
		;MOVF ADRESH,W
		;MOVWF voltage
		;XORLW 0XFF
		;BTFSC STATUS,Z
		RETURN	

INIT_PARAMETERS
		BANKSEL EECON1
		BCF EECON1,RD  ;Stop EEPROM reading process
		BANKSEL CCPR1L  
		CLRF CCPR1L ;clear duty cycle of CCPR3L
		CLRF CCPR2L ;clear duty cycle of CCPR2L
		BANKSEL CCPR3L
		CLRF CCPR3L ;clear duty cycle of CCPR3L
		RETURN
		
delay1
	MOVLW d'2'
	MOVWF tmp2
delay2
	DECFSZ tmp2,f
	GOTO delay2
	RETURN


delay_1us

		MOVLW d'5'
		MOVWF tmp2
delay4
		DECFSZ tmp2,f
		GOTO delay4
		RETURN 
	END
 
Last edited:

Try adding 120 and 270 as offsets to get the other two signals.
 

Sorry but that program is nonsense and you have ignored all the advice given earlier.

Forget the code for now, you first have to work out the correct program flow. Please think about it and draw a flow chart then post it here for us to see. Just copying bits of code from other programs will never work. I suspect if you get it right, the program will be a lot simpler than the one you currently have.

Brian.
 

Hi betwixt, KlausST and others. I am trying to help jean12. I have never written a program to generate sine wave from PWM or generate SPWM signal. I am referring to these two webpages and using the same cades and modifying it to generate 3 SPWM signals for the PIC he is using. He is using 20 MHz clock but for now I am using 16 MHz clock same as used by Tahmid. I am attaching my project and Proteus 8.2 SP2 format simualation file. The attachment also includes
screenshot of simulation. sine wave of 1st channel is not perfect.

I have used three arrays. I have used Tahmid's sine table generation software.

Can anybody tell why I am not getting the PWM2 and PWm3 ?

jean12 want sime wave of freq's 0 to 35 Hz based on ADC value. I have not yet implemented. If Tahmid's code works fine then I will add ADC code and V/F code implementation.

The file uploader is not working for me right now. I will post the file later. Here is the links I referred and the code.

https://tahmidmc.blogspot.in/2012/10/generation-of-sine-wave-using-spwm-in_10.html

https://tahmidmc.blogspot.in/2013/02/demystifying-use-of-table-pointer-in.html


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
char i = 0;
 
unsigned char sin_table_0_180[32]={0, 25, 49, 73, 96, 118, 137, 159, 177, 193, 208, 220, 231, 239, 245, 249, 250,
                             249, 245, 239, 231, 220, 208, 193, 177, 159, 137, 118, 96, 73, 49, 25};
 
unsigned char sin_table_120_300[32]={120, 145, 169, 193, 216, 238, 259, 279, 297, 313, 328, 340, 351, 359, 365, 369,
                                     370, 369, 365, 359, 351, 340, 328, 313, 297, 279, 259, 238, 216, 193, 169, 145};
                             
unsigned char sin_table_300_480[32]={270, 295, 319, 343, 366, 388, 409, 429, 447, 463, 478, 490, 501, 509, 515, 519,
                                     520, 519, 515, 509, 501, 490, 478, 463, 447, 429, 409, 388, 366, 343, 319, 295};
                             
unsigned int frequency = 0;
 
unsigned int TBL_POINTER_NEW[3], TBL_POINTER_OLD[3], TBL_POINTER_SHIFT[3], SET_FREQ;
unsigned int TBL_temp[3];
unsigned char DUTY_CYCLE[3];
 
void interrupt(){
     if (TMR2IF_bit == 1) {
        TBL_POINTER_NEW[0] = TBL_POINTER_OLD[0] + SET_FREQ ;
        if (TBL_POINTER_NEW[0] < TBL_POINTER_OLD[0]){
           CCP1CON.P1M1 = ~CCP1CON.P1M1; //Reverse direction of full-bridge
        }
        TBL_POINTER_SHIFT[0] = TBL_POINTER_NEW[0] >> 11;
        DUTY_CYCLE[0] = TBL_POINTER_SHIFT[0];
        CCPR1L = sin_table_0_180[DUTY_CYCLE[0]];
        TBL_POINTER_OLD[0] = TBL_POINTER_NEW[0];
        
        TBL_POINTER_NEW[1] = TBL_POINTER_OLD[1] + SET_FREQ;
        if (TBL_POINTER_NEW[1] < TBL_POINTER_OLD[1]){
           CCP2CON.P2M1 = ~CCP2CON.P2M1; //Reverse direction of full-bridge
        }
        TBL_POINTER_SHIFT[1] = TBL_POINTER_NEW[1] >> 11;
        DUTY_CYCLE[1] = TBL_POINTER_SHIFT[1];
        CCPR2L = sin_table_120_300[DUTY_CYCLE[1]];
        TBL_POINTER_OLD[1] = TBL_POINTER_NEW[1];
        
        TBL_POINTER_NEW[2] = TBL_POINTER_OLD[2] + SET_FREQ;
        if (TBL_POINTER_NEW[2] < TBL_POINTER_OLD[2]){
           CCP3CON.P1M1 = ~CCP3CON.P1M1; //Reverse direction of full-bridge
        }
        TBL_POINTER_SHIFT[2] = TBL_POINTER_NEW[2] >> 11;
        DUTY_CYCLE[2] = TBL_POINTER_SHIFT[2];
        CCPR3L = sin_table_300_480[DUTY_CYCLE[2]];
        TBL_POINTER_OLD[2] = TBL_POINTER_NEW[2];
        
        TMR2IF_bit = 0;
     }
}
 
void main() {
 
     Delay_ms(200);
     
     ADCON1 = 0b10100000;
     FVRCON = 0x00;
     
     ANSELA = 0x01;
     ANSELB = 0x00;
 
     CM1CON0 = 0x00;
     CM2CON0 = 0x00;
     
     TRISA = 0x00;
 
     PORTA = 0x00;
     PORTB = 0x00;
     PORTC = 0x00;
     
     LATA = 0x00;
     LATB = 0x00;
     LATC = 0x00;
     
     SET_FREQ = 287;
     
     for(i = 0; i < 3; i++) {
         TBL_POINTER_SHIFT[i] = 0;
         TBL_POINTER_NEW[i] = 0;
         TBL_POINTER_OLD[i] = 0;
         DUTY_CYCLE[i] = 0;
     }
 
     PR2 = 410;
     TRISB = 0xFF;
     TRISC = 0xFF;
     
     PWM1_Init(16000);
     PWM2_Init(16000);
     PWM3_Init(16000);
 
     PWM1_Set_Duty(0);
     PWM2_Set_Duty(0);
     PWM3_Set_Duty(0);
 
     PWM1_Start();
     PWM2_Start();
     PWM3_Start();
     
     TMR2IF_bit = 0;
     T2CON = 4;
     while(TMR2IF_bit == 0);
     TMR2IF_bit = 0;
     
     TRISB = 0x00;
     TRISC = 0x00;
     
     TMR2IE_bit = 1;
     PEIE_bit = 1;
     GIE_bit = 1;
     
     while(1) {
     
     }
}

 

Hi betwixt, KlausST and others here is the zipped folder containing the files pic.programmer is saying above,
 

Attachments

  • 3SPWM.zip
    172.5 KB · Views: 59

I found that sine table used for PWM2 and PWM3 are wrong. If first array values are used for PWM2 and PWM3 then PWM 1 and PWM2 will generate proper sine wave but PWM3 sine wave will be slightly distorted.
 

Its possible that the wrong signals are being causes by few entries,but try to adapt those to see what we can get:
Code:
    unsigned char sin_table_0_180[34]={125,149,171,193,211,227,239,246,250,249,243,233,219,202,182,160,
                                         137,113,90,68,48,31,17,7,1,0,4,11,23,39,57,79,101,125};
unsigned char sin_table_120_300[34]= {21,10,2,0,2,10,21,37,56,77,101,125,125,149,173,194,213,229,240,248,250,248,240,229,
13,194,173,149,125,101,77,56,37};
unsigned char sin_table_300_480[34]={229,213,194,173,149,125,101,77,56,37,21,10,2,0,2,10,21,37,56,77,101,125,125,149,173,194,213,229,240,248,250,248,240,};
 

These arrays are not working for me. I 2nd and 3rd sine waves are distorted.
 

pic.programmer, your code in post #33 will ever work. hint: what is the maximum value an unsigned char can hold?

You only need one table, not three although it can be done that way at the expense of using extra memory. One table with three entry points is all you need as the data in them should be the same but shifted one third (120 degrees). All you need to do is offset the INDEX (offset) into the table so the angle shifted entries are selected for each of the PWM generators.

In post #36 the values in the tables are different, even allowing for the phase shift so the waveforms will never match.

The frequency is determined by how fast you advance through the entries in the table, this I assume will be decided by the ADC measurement which will have to be done using interrupts otherwise the waveforms will 'flatten' while waiting for the ADC conversion to complete.

I still think a flow chart is needed.

Brian.
 

I tried offsetting the index but that shifted the second signal. I used shifted arrasys and still the signals shift. I am getting sine waves for PWM1 and PWM2 but not for PWM3. Have a look at my new code. Proteus file included.
 

Attachments

  • 3 Phase SPWM.rar
    43 KB · Views: 71

Which compiler is it written for? I do not have a copy of Proteus (or want one) so I can't replicate your simulation. I'm not even sure it will work under Linux OS.

The basic idea, and this isn't actual code:
Code:
{
if(Phase1_index++ > MAX_TABLE_ENTRIES) Phase1_index = 0;  //  cycle the index through the table then restart again
if(Phase2_index++ > MAX_TABLE_ENTRIES) Phase2_index = 0;  //  cycle the index through the table then restart again
if(Phase3_index++ > MAX_TABLE_ENTRIES) Phase3_index = 0;  //  cycle the index through the table then restart again

Set_PWM1(SineTable[Phase1_index]);
Set_PWM2(SineTable[Phase2_index]);
Set_PWM3(SineTable[Phase3_index]);
}

Set the MAX_TABLE_ENTRIES to the number of entries in the sine table.
Initialise the values in "Phase1_index" to zero, "Phase2_index" to MAX_TABLE_ENTRIES/3 and "Phase3_index" to (MAX_TABLE_ENTRIES/3) * 2. This sets the index to the 120 degrees and 240 degrees entries.
Then call the routine using a timer interrupt to set the sine frequency.
To adjust the frequency, use an ADC interrupt to read the potentiometer to pre-set the timer.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top