programming an audio signal using pic18f and Interrupt service Routine

Home Forums Microcontrollers PIC Microcontroller programming an audio signal using pic18f and Interrupt service Routine

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #13656
    yamabonadine
    Participant

    <p style=”border: 0px; margin: 0px 10px 1em 0px; padding: 0px; color: #000000; font-family: Tahoma, sans-serif; font-size: 12px;”>Hi,</p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px; color: #000000; font-family: Tahoma, sans-serif; font-size: 12px;”><span id=”result_box” lang=”en” style=”border: 0px; margin: 0px; padding: 0px;” xml:lang=”en”><span style=”border: 0px; margin: 0px; padding: 0px;”>I have in my pocession a microphone, an amplifier and a pic18f452.</span> <span style=”border: 0px; margin: 0px; padding: 0px;”>I have already connected the microphone to the amplifier.</span> <span style=”border: 0px; margin: 0px; padding: 0px;”>I did it on a turntable.</span> <span style=”border: 0px; margin: 0px; padding: 0px;”>I will connect the output of my microphone on the deck with an annalog port on the picdem Board and ground with ground on the picdem board.</span> <span style=”border: 0px; margin: 0px; padding: 0px;”>The channelA0 of the picdem board is reserved for the potentiometer so I have to use another port different from port A to connect the output of my Microphone, for exemple PORTC.</span>
    <span style=”border: 0px; margin: 0px; padding: 0px;”>concerning programming I have to write a program that allows me to digitize this analog signal from the microphone and send it through the uart of my picdem board to a module blutooth HC05. the Picdem Board have an integrated ADC (10bit).</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px; color: #000000; font-family: Tahoma, sans-serif; font-size: 12px;”>this is what i already do.can you suggest me anything? MY CODE</p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px; color: #000000; font-family: Tahoma, sans-serif; font-size: 12px;”></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma config OSC=HS,WDT=OFF,LVP=OFF // HS Oszillator, Watchdog Timer disabled, Low Voltage Programming</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#include “p18f452.h”</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#include “lcd.h”</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>extern void lcd_printf (const char* message);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>extern void lcd_gotoxy (char row,char column);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>extern void lcd_clear (void);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>extern void lcd_init (void);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>extern void lcd_byte (char num);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>extern void lcd_int (int num);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>extern void lcd_putc (char num);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void high_prior_InterruptHandler (void);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void low_prior_InterruptHandler (void);</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>unsigned int x=0, y=0;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>unsigned char signal_in[];</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>unsigned char signal_out[];</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>unsigned char empfangspuffer,sendepuffer;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma code high_prior_InterruptVector = 0x08</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void high_prior_InterruptVector(void)</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>{</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> _asm</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> goto high_prior_InterruptHandler</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> _endasm</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>}</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma code low_prior_InterruptVector = 0x18</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void low_prior_InterruptVector(void)</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>{</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> _asm</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> goto low_prior_InterruptHandler</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> _endasm</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>}</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void init (void)</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>{</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> lcd_init();</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> lcd_clear();</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>/*UART serielle Schnittstelle initialisieren*/</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> RCSTAbits.SPEN = 1; // Serial Port Enabled for TX & RX</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> RCSTAbits.CREN = 0; // Continuous Receive Enabled</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> TXSTAbits.BRGH = 1; // High Baud Rate Selected </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> SPBRG   = 25; // Naud Rate = FOSC / (16(X+1)) // 4MHZ Asynch & HSpeed</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> TXSTAbits.SYNC = 0;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>/*ISR ,Interrupt Serielle Schnittstelle initialisieren*/</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> PIE1bits.RCIE = 1; //Enable USART Interrupt</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> PIR1bits.RCIF = 0; //Clear USART RX Interrupt Flag</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> IPR1bits.RCIP = 1;  //High Priority Enable</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> TRISCbits.TRISC6 = 1; // 0b10111111;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>//AD-Interrupts </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> PIR1bits.ADIF = 0; // Clear ADC Interrupt Flag</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> IPR1bits.ADIP = 0; //SET to Low Priority</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> PIE1bits.ADIE = 1; // Enable ADC Interrupt</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>// Allgemeine Interrupts</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> RCONbits.IPEN = 1;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> INTCONbits.GIE =1;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> INTCONbits.PEIE =1;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>//AD Einstellungen</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>    TRISAbits.RA0 = 1;         //Port RA0 Poti auf Eingang setzen</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>    TRISEbits.RE0 = 1;         //configure RE0 as input pin for Microphone</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>    ADCON1=0x8B;            // Make RA0/AN0 and RE0 pin as analog pin </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>    ADCON0=0xA9;            //Fosc/32, Channel 5</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>    ADCON0bits.ADON = 1;     // Enable ADC</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>}</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>/* UART Receive*/</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma code</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma interrupt high_prior_InterruptHandler</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void high_prior_InterruptHandler(void)</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>{</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>              //code</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>}</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>/*sendung mit uart TX*/</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma code</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma interrupt low_prior_InterruptHandler</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void low_prior_InterruptHandler(void)</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>{</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>              //code</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>}</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>/*AD Wandlung*/</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma code</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>#pragma interrupt low_prior_InterruptHandler</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void low_prior_InterruptHandler(void)</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>{</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>    if(PIR1bits.ADIF == 1)          //A/D-Wandlung starten</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>    {</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>        x = ADRESH;                //A/D-Ergebnis Bit 2 bis 10</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>        y = ADRESL;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>        PIR1bits.ADIF = 0;</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>        ADCON0bits.GO_DONE = 1;   // ADC neu starten</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>    }</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>void main()</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>{</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”> </span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px;”><span style=”color: #000000; font-family: Tahoma, sans-serif;”><span style=”font-size: 12px;”>}</span></span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px; color: #000000; font-family: Tahoma, sans-serif; font-size: 12px;”><span lang=”en” style=”border: 0px; margin: 0px; padding: 0px;” xml:lang=”en”>i want your help for Programming please.</span></p>
    <p style=”border: 0px; margin: 1em 10px 1em 0px; padding: 0px; color: #000000; font-family: Tahoma, sans-serif; font-size: 12px;”><span lang=”en” style=”border: 0px; margin: 0px; padding: 0px;” xml:lang=”en”>Regards</span></p>

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
>