Output ADC as binary waveform on oscilloscopeIs there a printf converter to print in binary format?C++ “was not declared in this scope” compile error and modification tipsdigitalRead to String on arduinoHow can I digitalRead a pin and convert data to String on Arduino?ADC dsPIC33 issueArduino Uno PWM pins conflictPIC 18f4520 - Receiving data from serial using Rx interruptArduino Interrupt misbehavingW0223-ADC: ADC input voltage low. ADC output underflowMikrocontroller (PIC16F1827) ADC scrambled output with MCC in MPLAB

In what state are satellites left in when they are left in a graveyard orbit?

Difference in using Lightning Component <lighting:badge/> and Normal DOM with slds <span class="slds-badge"></span>? Which is Better and Why?

Can I conceal an antihero's insanity - and should I?

Why does the speed of sound decrease at high altitudes although the air density decreases?

Finding the number of digits of a given integer.

POSIX compatible way to get user name associated with a user ID

Bit one of the Intel 8080's Flags register

The Planck constant for mathematicians

Should I leave the first authorship of our paper to the student who did the project whereas I solved it?

What is the mathematical notation for rounding a given number to the nearest integer?

Double it your way

Does deswegen have another meaning than "that is why"?

What is this gigantic dish at Ben Gurion airport?

Why is the T-1000 humanoid?

Karazuba Algorithm with arbitrary bases

I was promised a work PC but still awaiting approval 3 months later so using my own laptop - Is it fair to ask employer for laptop insurance?

Is there a real-world mythological counterpart to WoW's "kill your gods for power" theme?

What are uses of the byte after BRK instruction on 6502?

Why is this weapon searching for a new owner?

Can I toggle Do Not Disturb on/off on my Mac as easily as I can on my iPhone?

Why is the Digital 0 not 0V in computer systems?

Why do sellers care about down payments?

What organs or modifications would be needed for a life biological creature not to require sleep?

What is a realistic time needed to get a properly trained army?



Output ADC as binary waveform on oscilloscope


Is there a printf converter to print in binary format?C++ “was not declared in this scope” compile error and modification tipsdigitalRead to String on arduinoHow can I digitalRead a pin and convert data to String on Arduino?ADC dsPIC33 issueArduino Uno PWM pins conflictPIC 18f4520 - Receiving data from serial using Rx interruptArduino Interrupt misbehavingW0223-ADC: ADC input voltage low. ADC output underflowMikrocontroller (PIC16F1827) ADC scrambled output with MCC in MPLAB






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I´m building a project where i want to transfer an analog signal from a mikrocontroller (PIC16F1827) to an Arduino via IR-diodes. The PIC takes a analog signal (0-5 V) from a potentiometer (10k Ohm) and converts it with ADC to 8-bit digital code. After that i want to send the binary code that i get from the conversion over IR.
My plan is to have the output do a squarewave signal where the a "1" = HIGH and a "0" = LOW.
ex. input = 3.093V which gives the binary code "10011100" this would then be converted to a squarwave output "HIGH,LOW,LOW,HIGH,HIGH,HIGH,LOW,LOW" so that my IR diode can send it as a package.



The Arduino with an IR transmitter is connected directly to an Arduino Nano on my bread board.



The PIC code only generates a 4000 Hz PWM signal right now but thats wrong, i have not managed to get i to represent it in the wanted "bit signal". The PWM signal is correct and I can se the PWM signal good on my oscilloscope where the duty cycle span is around (0-92%) so around (0-4.6 V).



// INCLUDE
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>

// CONFIG
#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled)
#pragma config BOREN = OFF // Brown-out Reset Enable bit (BOR disabled)
#pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)

#define _XTAL_FREQ 4000000 //Klockoscillatorfrekvens Fosc=4 MHz
#define BAUDRATE 9600



//Datasheet PIC16F1827
//PWM on page = DS41391D-page 208


//Prototype ---------------------------------------------------------
void PWM_Initialize();
void ADC_Initialize();
unsigned int ADC_Read(unsigned char channel);
void init();
void main();

//----------------------------
void PWM_Initialize()

PR2 = 254;
CCP3CON = 0b00001100; //CCP3 i PWM-mode
CCPTMRS = 0b01001010; //CCP3 use Timer2
T2CON = 0b00100100; //Timer2 On, Pre-scaler = 1 gives PWM = 4 kHz
//PR2 = 0b00011001 ;
//T2CON = 0b00000101 ;
//CCPR1L = 0b00001100 ;
//CCP3CON = 0b00111100 ;


//------------------------------
void ADC_Initialize()

ADCON0 = 0x01; //ADON
ADCON1 = 0b01000000; //Left written, AD-clock = Fosc / 4, Vref VDD och VSS
ADRESL = 0x00;
ADRESH = 0x00;


//------------------------------------------
unsigned int ADC_Read(unsigned char channel)

ADCON0 = (ADCON0 & 0b10000011)
//----------------------------------------------
void init()

OSCCON = 0b01101000; //Intern clock 4 MHz
OSCTUNE = 0x00; // TUN 0;
BORCON = 0x00; // SBOREN disabled;
ANSELA = 0b00000001; //PortA bit 0 (RA0) analog, all other bit digital
ANSELB = 0b00000000; //PORTB alla bits digital
TRISA = 0b00100001; //PORTA bit 0 (RA0) and 5 (RA5) input, rest output
TRISB = 0x00000000; //PORTB all as output

//Main-program ----------------------------------------------------------------
void main()
{
int adc_value;
init(); // Init PORTS
ADC_Initialize(); // Initializes ADC Module
PWM_Initialize(); // This sets the PWM frequency of PWM1
do

adc_value = ADC_Read(0); //Reading Analog Channel 0 from RA0
PORTB = adc_value; // Indicate bit numbers with 8 LED´s on PORT (RB0-RB7) for tetsing
__delay_ms(50);
CCPR3L = adc_value; // ADC to PWM signal converter
__delay_ms(50);

while(1); //Infinite Loop



How do i get this conversion? Like this:



enter image description here



I have no knowledge i how to set a squarewave HIGH for x us "to represent a 1 in the squarewave output" and set the squarewave LOW for y us "to represent a 0 in the squarewave output"



so for exempel how do i write a code that for Ex




if ADC_read = "1"
set squarewave HIGH for 600 us;

if ADC_read"0"
set squarewave LOW for 1000 us;


enter image description here



Would appreciate any help, Thanks!










share|improve this question





















  • 6





    What is your question?

    – user6556709
    Mar 28 at 10:26






  • 2





    datasheet is your friend.

    – Kamil Cuk
    Mar 28 at 11:00







  • 1





    I told you to use the UART of the controller. TXREG = adc_value;

    – Mike
    Mar 28 at 11:07






  • 1





    The PWM peripheral isn't suitable for this. You'll have to use timers and manual bit-banging. Or if you want start and stop bits, simply use your UART hardware and hook UART tx to the IR diodes.

    – Lundin
    Mar 28 at 12:25











  • Hey, okey! Thanks for the input, I have changed my code to follow the "Asynchronous Transmission" with Usart and i get the right binary sent to TXREG. But how do i send the binary value out from the pic? I don´t any output on Tx, am i missing something?

    – Filip Kaiser
    Mar 28 at 13:40

















0















I´m building a project where i want to transfer an analog signal from a mikrocontroller (PIC16F1827) to an Arduino via IR-diodes. The PIC takes a analog signal (0-5 V) from a potentiometer (10k Ohm) and converts it with ADC to 8-bit digital code. After that i want to send the binary code that i get from the conversion over IR.
My plan is to have the output do a squarewave signal where the a "1" = HIGH and a "0" = LOW.
ex. input = 3.093V which gives the binary code "10011100" this would then be converted to a squarwave output "HIGH,LOW,LOW,HIGH,HIGH,HIGH,LOW,LOW" so that my IR diode can send it as a package.



The Arduino with an IR transmitter is connected directly to an Arduino Nano on my bread board.



The PIC code only generates a 4000 Hz PWM signal right now but thats wrong, i have not managed to get i to represent it in the wanted "bit signal". The PWM signal is correct and I can se the PWM signal good on my oscilloscope where the duty cycle span is around (0-92%) so around (0-4.6 V).



// INCLUDE
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>

// CONFIG
#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled)
#pragma config BOREN = OFF // Brown-out Reset Enable bit (BOR disabled)
#pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)

#define _XTAL_FREQ 4000000 //Klockoscillatorfrekvens Fosc=4 MHz
#define BAUDRATE 9600



//Datasheet PIC16F1827
//PWM on page = DS41391D-page 208


//Prototype ---------------------------------------------------------
void PWM_Initialize();
void ADC_Initialize();
unsigned int ADC_Read(unsigned char channel);
void init();
void main();

//----------------------------
void PWM_Initialize()

PR2 = 254;
CCP3CON = 0b00001100; //CCP3 i PWM-mode
CCPTMRS = 0b01001010; //CCP3 use Timer2
T2CON = 0b00100100; //Timer2 On, Pre-scaler = 1 gives PWM = 4 kHz
//PR2 = 0b00011001 ;
//T2CON = 0b00000101 ;
//CCPR1L = 0b00001100 ;
//CCP3CON = 0b00111100 ;


//------------------------------
void ADC_Initialize()

ADCON0 = 0x01; //ADON
ADCON1 = 0b01000000; //Left written, AD-clock = Fosc / 4, Vref VDD och VSS
ADRESL = 0x00;
ADRESH = 0x00;


//------------------------------------------
unsigned int ADC_Read(unsigned char channel)

ADCON0 = (ADCON0 & 0b10000011)
//----------------------------------------------
void init()

OSCCON = 0b01101000; //Intern clock 4 MHz
OSCTUNE = 0x00; // TUN 0;
BORCON = 0x00; // SBOREN disabled;
ANSELA = 0b00000001; //PortA bit 0 (RA0) analog, all other bit digital
ANSELB = 0b00000000; //PORTB alla bits digital
TRISA = 0b00100001; //PORTA bit 0 (RA0) and 5 (RA5) input, rest output
TRISB = 0x00000000; //PORTB all as output

//Main-program ----------------------------------------------------------------
void main()
{
int adc_value;
init(); // Init PORTS
ADC_Initialize(); // Initializes ADC Module
PWM_Initialize(); // This sets the PWM frequency of PWM1
do

adc_value = ADC_Read(0); //Reading Analog Channel 0 from RA0
PORTB = adc_value; // Indicate bit numbers with 8 LED´s on PORT (RB0-RB7) for tetsing
__delay_ms(50);
CCPR3L = adc_value; // ADC to PWM signal converter
__delay_ms(50);

while(1); //Infinite Loop



How do i get this conversion? Like this:



enter image description here



I have no knowledge i how to set a squarewave HIGH for x us "to represent a 1 in the squarewave output" and set the squarewave LOW for y us "to represent a 0 in the squarewave output"



so for exempel how do i write a code that for Ex




if ADC_read = "1"
set squarewave HIGH for 600 us;

if ADC_read"0"
set squarewave LOW for 1000 us;


enter image description here



Would appreciate any help, Thanks!










share|improve this question





















  • 6





    What is your question?

    – user6556709
    Mar 28 at 10:26






  • 2





    datasheet is your friend.

    – Kamil Cuk
    Mar 28 at 11:00







  • 1





    I told you to use the UART of the controller. TXREG = adc_value;

    – Mike
    Mar 28 at 11:07






  • 1





    The PWM peripheral isn't suitable for this. You'll have to use timers and manual bit-banging. Or if you want start and stop bits, simply use your UART hardware and hook UART tx to the IR diodes.

    – Lundin
    Mar 28 at 12:25











  • Hey, okey! Thanks for the input, I have changed my code to follow the "Asynchronous Transmission" with Usart and i get the right binary sent to TXREG. But how do i send the binary value out from the pic? I don´t any output on Tx, am i missing something?

    – Filip Kaiser
    Mar 28 at 13:40













0












0








0








I´m building a project where i want to transfer an analog signal from a mikrocontroller (PIC16F1827) to an Arduino via IR-diodes. The PIC takes a analog signal (0-5 V) from a potentiometer (10k Ohm) and converts it with ADC to 8-bit digital code. After that i want to send the binary code that i get from the conversion over IR.
My plan is to have the output do a squarewave signal where the a "1" = HIGH and a "0" = LOW.
ex. input = 3.093V which gives the binary code "10011100" this would then be converted to a squarwave output "HIGH,LOW,LOW,HIGH,HIGH,HIGH,LOW,LOW" so that my IR diode can send it as a package.



The Arduino with an IR transmitter is connected directly to an Arduino Nano on my bread board.



The PIC code only generates a 4000 Hz PWM signal right now but thats wrong, i have not managed to get i to represent it in the wanted "bit signal". The PWM signal is correct and I can se the PWM signal good on my oscilloscope where the duty cycle span is around (0-92%) so around (0-4.6 V).



// INCLUDE
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>

// CONFIG
#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled)
#pragma config BOREN = OFF // Brown-out Reset Enable bit (BOR disabled)
#pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)

#define _XTAL_FREQ 4000000 //Klockoscillatorfrekvens Fosc=4 MHz
#define BAUDRATE 9600



//Datasheet PIC16F1827
//PWM on page = DS41391D-page 208


//Prototype ---------------------------------------------------------
void PWM_Initialize();
void ADC_Initialize();
unsigned int ADC_Read(unsigned char channel);
void init();
void main();

//----------------------------
void PWM_Initialize()

PR2 = 254;
CCP3CON = 0b00001100; //CCP3 i PWM-mode
CCPTMRS = 0b01001010; //CCP3 use Timer2
T2CON = 0b00100100; //Timer2 On, Pre-scaler = 1 gives PWM = 4 kHz
//PR2 = 0b00011001 ;
//T2CON = 0b00000101 ;
//CCPR1L = 0b00001100 ;
//CCP3CON = 0b00111100 ;


//------------------------------
void ADC_Initialize()

ADCON0 = 0x01; //ADON
ADCON1 = 0b01000000; //Left written, AD-clock = Fosc / 4, Vref VDD och VSS
ADRESL = 0x00;
ADRESH = 0x00;


//------------------------------------------
unsigned int ADC_Read(unsigned char channel)

ADCON0 = (ADCON0 & 0b10000011)
//----------------------------------------------
void init()

OSCCON = 0b01101000; //Intern clock 4 MHz
OSCTUNE = 0x00; // TUN 0;
BORCON = 0x00; // SBOREN disabled;
ANSELA = 0b00000001; //PortA bit 0 (RA0) analog, all other bit digital
ANSELB = 0b00000000; //PORTB alla bits digital
TRISA = 0b00100001; //PORTA bit 0 (RA0) and 5 (RA5) input, rest output
TRISB = 0x00000000; //PORTB all as output

//Main-program ----------------------------------------------------------------
void main()
{
int adc_value;
init(); // Init PORTS
ADC_Initialize(); // Initializes ADC Module
PWM_Initialize(); // This sets the PWM frequency of PWM1
do

adc_value = ADC_Read(0); //Reading Analog Channel 0 from RA0
PORTB = adc_value; // Indicate bit numbers with 8 LED´s on PORT (RB0-RB7) for tetsing
__delay_ms(50);
CCPR3L = adc_value; // ADC to PWM signal converter
__delay_ms(50);

while(1); //Infinite Loop



How do i get this conversion? Like this:



enter image description here



I have no knowledge i how to set a squarewave HIGH for x us "to represent a 1 in the squarewave output" and set the squarewave LOW for y us "to represent a 0 in the squarewave output"



so for exempel how do i write a code that for Ex




if ADC_read = "1"
set squarewave HIGH for 600 us;

if ADC_read"0"
set squarewave LOW for 1000 us;


enter image description here



Would appreciate any help, Thanks!










share|improve this question
















I´m building a project where i want to transfer an analog signal from a mikrocontroller (PIC16F1827) to an Arduino via IR-diodes. The PIC takes a analog signal (0-5 V) from a potentiometer (10k Ohm) and converts it with ADC to 8-bit digital code. After that i want to send the binary code that i get from the conversion over IR.
My plan is to have the output do a squarewave signal where the a "1" = HIGH and a "0" = LOW.
ex. input = 3.093V which gives the binary code "10011100" this would then be converted to a squarwave output "HIGH,LOW,LOW,HIGH,HIGH,HIGH,LOW,LOW" so that my IR diode can send it as a package.



The Arduino with an IR transmitter is connected directly to an Arduino Nano on my bread board.



The PIC code only generates a 4000 Hz PWM signal right now but thats wrong, i have not managed to get i to represent it in the wanted "bit signal". The PWM signal is correct and I can se the PWM signal good on my oscilloscope where the duty cycle span is around (0-92%) so around (0-4.6 V).



// INCLUDE
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>

// CONFIG
#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled)
#pragma config BOREN = OFF // Brown-out Reset Enable bit (BOR disabled)
#pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)

#define _XTAL_FREQ 4000000 //Klockoscillatorfrekvens Fosc=4 MHz
#define BAUDRATE 9600



//Datasheet PIC16F1827
//PWM on page = DS41391D-page 208


//Prototype ---------------------------------------------------------
void PWM_Initialize();
void ADC_Initialize();
unsigned int ADC_Read(unsigned char channel);
void init();
void main();

//----------------------------
void PWM_Initialize()

PR2 = 254;
CCP3CON = 0b00001100; //CCP3 i PWM-mode
CCPTMRS = 0b01001010; //CCP3 use Timer2
T2CON = 0b00100100; //Timer2 On, Pre-scaler = 1 gives PWM = 4 kHz
//PR2 = 0b00011001 ;
//T2CON = 0b00000101 ;
//CCPR1L = 0b00001100 ;
//CCP3CON = 0b00111100 ;


//------------------------------
void ADC_Initialize()

ADCON0 = 0x01; //ADON
ADCON1 = 0b01000000; //Left written, AD-clock = Fosc / 4, Vref VDD och VSS
ADRESL = 0x00;
ADRESH = 0x00;


//------------------------------------------
unsigned int ADC_Read(unsigned char channel)

ADCON0 = (ADCON0 & 0b10000011)
//----------------------------------------------
void init()

OSCCON = 0b01101000; //Intern clock 4 MHz
OSCTUNE = 0x00; // TUN 0;
BORCON = 0x00; // SBOREN disabled;
ANSELA = 0b00000001; //PortA bit 0 (RA0) analog, all other bit digital
ANSELB = 0b00000000; //PORTB alla bits digital
TRISA = 0b00100001; //PORTA bit 0 (RA0) and 5 (RA5) input, rest output
TRISB = 0x00000000; //PORTB all as output

//Main-program ----------------------------------------------------------------
void main()
{
int adc_value;
init(); // Init PORTS
ADC_Initialize(); // Initializes ADC Module
PWM_Initialize(); // This sets the PWM frequency of PWM1
do

adc_value = ADC_Read(0); //Reading Analog Channel 0 from RA0
PORTB = adc_value; // Indicate bit numbers with 8 LED´s on PORT (RB0-RB7) for tetsing
__delay_ms(50);
CCPR3L = adc_value; // ADC to PWM signal converter
__delay_ms(50);

while(1); //Infinite Loop



How do i get this conversion? Like this:



enter image description here



I have no knowledge i how to set a squarewave HIGH for x us "to represent a 1 in the squarewave output" and set the squarewave LOW for y us "to represent a 0 in the squarewave output"



so for exempel how do i write a code that for Ex




if ADC_read = "1"
set squarewave HIGH for 600 us;

if ADC_read"0"
set squarewave LOW for 1000 us;


enter image description here



Would appreciate any help, Thanks!







c arduino pic mplab






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 10:58







Filip Kaiser

















asked Mar 28 at 10:23









Filip KaiserFilip Kaiser

226 bronze badges




226 bronze badges










  • 6





    What is your question?

    – user6556709
    Mar 28 at 10:26






  • 2





    datasheet is your friend.

    – Kamil Cuk
    Mar 28 at 11:00







  • 1





    I told you to use the UART of the controller. TXREG = adc_value;

    – Mike
    Mar 28 at 11:07






  • 1





    The PWM peripheral isn't suitable for this. You'll have to use timers and manual bit-banging. Or if you want start and stop bits, simply use your UART hardware and hook UART tx to the IR diodes.

    – Lundin
    Mar 28 at 12:25











  • Hey, okey! Thanks for the input, I have changed my code to follow the "Asynchronous Transmission" with Usart and i get the right binary sent to TXREG. But how do i send the binary value out from the pic? I don´t any output on Tx, am i missing something?

    – Filip Kaiser
    Mar 28 at 13:40












  • 6





    What is your question?

    – user6556709
    Mar 28 at 10:26






  • 2





    datasheet is your friend.

    – Kamil Cuk
    Mar 28 at 11:00







  • 1





    I told you to use the UART of the controller. TXREG = adc_value;

    – Mike
    Mar 28 at 11:07






  • 1





    The PWM peripheral isn't suitable for this. You'll have to use timers and manual bit-banging. Or if you want start and stop bits, simply use your UART hardware and hook UART tx to the IR diodes.

    – Lundin
    Mar 28 at 12:25











  • Hey, okey! Thanks for the input, I have changed my code to follow the "Asynchronous Transmission" with Usart and i get the right binary sent to TXREG. But how do i send the binary value out from the pic? I don´t any output on Tx, am i missing something?

    – Filip Kaiser
    Mar 28 at 13:40







6




6





What is your question?

– user6556709
Mar 28 at 10:26





What is your question?

– user6556709
Mar 28 at 10:26




2




2





datasheet is your friend.

– Kamil Cuk
Mar 28 at 11:00






datasheet is your friend.

– Kamil Cuk
Mar 28 at 11:00





1




1





I told you to use the UART of the controller. TXREG = adc_value;

– Mike
Mar 28 at 11:07





I told you to use the UART of the controller. TXREG = adc_value;

– Mike
Mar 28 at 11:07




1




1





The PWM peripheral isn't suitable for this. You'll have to use timers and manual bit-banging. Or if you want start and stop bits, simply use your UART hardware and hook UART tx to the IR diodes.

– Lundin
Mar 28 at 12:25





The PWM peripheral isn't suitable for this. You'll have to use timers and manual bit-banging. Or if you want start and stop bits, simply use your UART hardware and hook UART tx to the IR diodes.

– Lundin
Mar 28 at 12:25













Hey, okey! Thanks for the input, I have changed my code to follow the "Asynchronous Transmission" with Usart and i get the right binary sent to TXREG. But how do i send the binary value out from the pic? I don´t any output on Tx, am i missing something?

– Filip Kaiser
Mar 28 at 13:40





Hey, okey! Thanks for the input, I have changed my code to follow the "Asynchronous Transmission" with Usart and i get the right binary sent to TXREG. But how do i send the binary value out from the pic? I don´t any output on Tx, am i missing something?

– Filip Kaiser
Mar 28 at 13:40












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55395215%2foutput-adc-as-binary-waveform-on-oscilloscope%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55395215%2foutput-adc-as-binary-waveform-on-oscilloscope%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현