How to receive IR signal in PIC18F - infrared

I need to receive signal from IR transmitter LED. I am not sure how to program the microcontroler. I am looking for some concept, how to do that. Whether I have to use A/D conversion? How to synchronize transmitter and receiver? What structure will be in coming data? Let's say that I assumed 600us for 0 (binary 0) and 1200 for 1 (binary 1) when I was programming a transmitter. What are the common steps to receive infrared transmission on PIC18F microcontroler?

It depends on the protocol you're trying to send over IR. If you can use RS232 and FM, then you just need an FM decoder (a PLL will do) and you can connect it to the PIC's serial port.

Related

How do i get a 100kbps clock for an I2C on Quartus Prime?

I am doing a university project in which i have to build a I2C which have only one slave and will have to transmit a data with 5 bits, 4 bits for the number which is in the range of 0 to 9 and 1 bit to read or write, i'm using a DE10-LITE with VHDL for this project, which has a 50 Mhz default clock, i was looking into the "ALTPLL" inside quartus prime but i can't find the option to set my clock to 100kbps, i did find in the in some forums that the "Set up PLL in LVDS mode" enables that, but for some reason quartus won't let me activate it. My SDA will be 100kbps, and the SCL 50mhz.
As the Other people have said: You don't need a PLL for that. If you already have a default clock of 50MHz then you just need to divide that by 500, using a counter, and then you have your 100kHz clock.
Anyways, you would want to start the counter only when there is a request on the bus. So user16145658 is correct: The generated clock should be the output of your state machine.
You don't need to change the clock of the FPGA, since you are using an FPGA, you only need to implement an i2c core to communicate with the i2c device.
And the i2c specification specifies the rate of i2c
Standard mode (Sm) 100 kbit/s
Fast mode (Fm) 400 kbit/s

Using micropython on ESP32, how to have 2 PWM pins with different frequencies?

When I initialise two PWM pins on ESP32 using micropython I found the two pins are always on the same PWM frequency.
motorPin1 = machine.PWM(Pin(21, mode=Pin.OUT))
motorPin1.duty(512)
motorPin1.freq(10)
motorPin2 = machine.PWM(Pin(22, mode=Pin.OUT))
motorPin2.duty(300)
motorPin2.freq(200)
In the above example, both motorPin1 & motorPin2 end up on the same frequency. Also if the frequency on one pin is updated, it will also update the frequency on the other (to the same frequency). Duty cycle can be controlled separately but not frequency.
I eventually found ESP32 has pwm 'channels' which are driven/timed in pairs. So for example, if you have two PWM pins assigned to channels 0 & 1, they will always run at the same frequency.
The micropython PWM interface doesn't expose the PWM channel assigned to a pin.
How do people setup PWM pins in micropython with the appropriate PWM channels to allow separate control of the frequency?
Unfortunately this hardware functionality is not currently available in MicroPython - there is an open PR to add this: https://github.com/micropython/micropython/pull/3608
You could look into bit-banging or utilising timers if your needs are more basic, otherwise you could provide support for getting the PR merged!

Esp32 Low Frequency PWM

Good morning I need to perform a 0.4 Hz pwm and with LEDC I can only reach 1 hz in esp32. Could you tell me if there is a possibility to do it?
I assume you are currently using the functions from some esp32 library. Like in the Arduino world, there is another way. You can set the right Bits so you manually create a PWM signal. Here is the Technical Reference Manual:
https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
You will find all the relevant Information in chapter 14 (LED_PWM).

How to get response from adv7513 i2c

I want to use hdmi monitor with cyclone V GX board, but I don't get an acknowledgement from adv7513 on i2c bus.
I think there is a problem with the address that I am sending at the beginning of the i2c transaction (I get no acknowledgement of address) I couldn't find information on whether PD/AD is low or high. Also I am not sure if i should use 7 or 8 bit address, so I would like some explanation.
I used i2c controller that i found online:
https://www.digikey.com/eewiki/pages/viewpage.action?pageId=10125324
signaltap result
I assume you haven't read the ADV7513 Programming Guide
The ADV7513 uses four I2C register maps. The SDA/SCL programming
address for the Main Register Map is 0x72 or 0x7A, based on whether
PD/AD is pulled high (10KΩ resistor to power supply = 0x7A) or pulled
low (10KΩ resistor to GND = 0x72) when power is applied to the
supplies. The user should wait 200ms for the address to be decided,
after the power supplies are high, before attempting to communicate
with the ADV7513 using I2C
I2C addresses are 7-bit or 10-bit not 8-bit. In this case it is 7-bit.
See I2C Specification. So if PD/AD is high, 7-bit address is 0x7A. In binary your 7 bits will be: 1111010. The R/W bit is the last bit of the first I2C 'address' byte but the vhd code you posted doesn't need that as part of the address, that's done separately.
addr : IN STD_LOGIC_VECTOR(6 DOWNTO 0); --address of target slave
rw : IN STD_LOGIC; --'0' is write, '1' is read
If you are still having problems, check your pull-ups, I2C SCL clock rate, ensure the master allows clock stretching. The VHDL code you posted has quite a lot of information about how to use so re-read that.
Alternatively take to question to Electrical Engineering Stack Exchange and take some oscilloscope readings of SDA/SCL.

Output from an ADC is needed to be stored in memory

We want to take the output of a 16-bit Analog to Digital Converter, which is coming at a rate of 10 million samples per second and SAVE the sequence of 16 output bits in a computer memory. How to save this 16-bit binary voltage signal (0V, 5V) in a computer memory?
If a FPGA is to be used, please elaborate the method.
Sample Data and feed to fifo
Take data from fifo and prepare UDP frames and send data over ethernet
Received UDP packets on PC side and put in memory

Resources