How to change pin voltage in quartus ii? - fpga

I'm trying to change pin voltage on 'Altera cyclone 4 FPGA' in Quartus? I have changed it in a pin planner and source voltage. But, unfortunately, the voltmeter always show '3 - 3.3 V'.
Am I missing something. Please, advise.

You can't change pin voltages from Quartus. The I/O voltage is equal to the voltage you supply at VCCIO (for that particular I/O bank).
The Quartus setting is to tell the design tools what voltage your hardware will be using so that timing and power consumption calculations will be correct.
As shown by this table in the device datasheet, the I/O Standard and VCCIO voltage level are linked, you cannot select an I/O standard at a different voltage without changing the I/O supply voltage your PCB provides to the FPGA VCCIO pins.

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

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 interface both pcf8563 rtc and 24lc512 eeprom with 1K pullup resistor on sda and scl

i have been working on a code where both 24lc512 and pcf8563 are interfaced together. Here in the breakup board of pcf8563 there are two 1K pull-up resistor on SDA and SCL line so am planning on using the same resistors for eeprom.
I had a code for eeprom which worked perfectly before with 4.7K pull up resistor, so i for making the code work for 1K pull-up resistor i made the following changes.(Coding was done for PIC16f877a with XC8 compiler)
SSPSTAT=0x80
SSPADD=(_XTAL_FREQ/(4*c))-1 //where c is 400,000
But sadly the code is not working as expected.Could someone please lend me help by saying what all changes should i bring in the earlier code so that it can work with 1K pull-up resistor.
Thanks in advance :)
The datasheet says
R = tr/Cb
where
tr is rise time (maximum specified at 1us)
Cb is capacitive load for each bus line with specified max. of 400 pF.
1x10^6 / 400x10^12 = 2500, so 2.7K would be the best choice if you're close to the maximum capacitance.
1K ohm sounds a bit low though, I'd try to unsolder the resistors and use 2.7 to 4.7k ohm instead. Only one set is needed if the bus lines are kept short.
Use an oscilloscope to check the signal shape. If the traces aren't nice and square then you need to adjust the resistors or shorten the bus wires. If the rise time is longer than 1us it may have problems too.
It would make much more sense to use a much lower bus speed, capacitance won't be much of a big deal. For a calender and a small eeprom 100K or even lower is plenty fast enough in most circumstances.

Multiple PWM Channels on PIC

I use the PIC16F88 for my project, with XC8 compiler.
What I'm trying to achieve is to control 4 LEDs with 4 buttons, when you press a buttons it increases the duty cycle of the corresponding LED by 10%.
When you press the button on RB0 it increases the duty cycle of the LED on RB4, and so on.
Every LED is independent, therefore it can have a different duty cycle.
The problem is that the PIC i'm using only have one PWM module on either RB0 or RB3 (using CCPMX bit).
After some research I decided to implement software PWM to have four different channels, each channels would control one duty cycle, but most of the sources I found didn't provide any explanation on how to do it.
Or is there a way to mirror PWM to multiple pins ?
Thanks by advance for helping me out.
Mirroring is not an option.
PWM is relatively simple. You have to set PWM frequency (which you will not change) and PWM duty cycle (which you need to change in order to have 0-100% voltage range). You have to decide about resolution of PWM, voltage step that you need (built in PWM for example is 8-bit and has 0-255 steps).
Finally, you have to set timer to interrupt based on PWM frequency * PWM resolution. In Timer ISR routine you need to check resolution counts and PWM value of all your channels. Resolution count will have to reset when resolution value is reached (and start to count from 0 again, all outputs go HIGH here, also). When PWM value of output is reached you have to toggle (pull it LOW) corresponding pin (and reset it back to HIGH with every resolution count reset).
This is only one way of doing it, involves only one timer and should be most simple since your PIC is low with resources.
Hope it helps...

IR emitter and PWM output

I have been using FRDM_KL46Z development board to do some IR communication experiment. Right now, I got two PWM outputs with same setting (50% duty cycle, 38 kHz) had different voltage levels. When both were idle, one was 1.56V, but another was 3.30V. When the outputs were used to power the same IR emitter, the voltages were changed to 1.13V and 2.29V.
And why couldn't I use one PWM output to power two IR emitters at the same time? When I tried to do this, it seemed that the frequency was changed, so two IR receivers could not work.
I am not an expert in freescale, but how are you controlling your pwm? I'm guessing each pwm comes from a separate timer, maybe they are set up differently. Like one is in 16 bit mode (the 3.3V) and the other in 32 (1.56v) in that case even if they have the same limit in the counter ((2^17 - 1) / 2) would be 50% duty cycle of a 16 bit timer. But in a 32 bit, that same value would only be 25% duty so, one output would be ~1/2 the voltage of the other. SO I suggest checking the timer setup.
The reason the voltage changed is because the IR emmiters were loading the circuit. In an ideal situation this wouldn't happen, but if a source is giving too much current the voltage usually drops a bit.

Resources