Search found 1691 matches

by Pito
Tue Jan 16, 2018 10:47 pm
Forum: Libraries & Hardware
Topic: Stm32f103C8 External Dac
Replies: 17
Views: 158

Re: Stm32f103C8 External Dac

Try to change the bits from the highest bit to the lowest (as I did in my code above). Like in your code: for (byte i=7; i >=0; i--) { byte state = bitRead(num, i); digitalWrite(DPINS[i], state); } I would recommend you to use my code above as it is much faster. Also you may add a capacitor from R2R...
by Pito
Mon Jan 15, 2018 6:00 pm
Forum: Libraries & Hardware
Topic: Stm32f103C8 External Dac
Replies: 17
Views: 158

Re: Stm32f103C8 External Dac

He may apply an algorithm, where the bits between the DAC samples change such the turmoil at the output will be minimal :)
by Pito
Mon Jan 15, 2018 2:48 pm
Forum: Libraries & Hardware
Topic: Stm32f103C8 External Dac
Replies: 17
Views: 158

Re: Stm32f103C8 External Dac

You may set the bits individually. First set the individual pins to outputs, then write the DACvalue: pinMode(PA0, OUTPUT); .. pinMode(PB12, OUTPUT); .. // write the DACvalue 0-255, 8bit digitalWrite(PA4, (DACvalue & 0x80)); // the highest DACvalue bit7 digitalWrite(PA3, (DACvalue & 0x40)); digitalW...
by Pito
Mon Jan 15, 2018 2:44 pm
Forum: STM32generic
Topic: SPI.transfer of byte crashes F407VET6?
Replies: 10
Views: 90

Re: SPI.transfer of byte crashes F407VET6?

SPI transactions are the most simple you may imagine. It just clocks out 8 bits and reads 8 bits in. That is all. The only issues I can imagine with using SPI with two or more different chips hanging on it: 1. wrong chip selects manipulation (you activate both chips during a transaction) 2. the chip...
by Pito
Mon Jan 15, 2018 2:16 pm
Forum: Libraries & Hardware
Topic: Stm32f103C8 External Dac
Replies: 17
Views: 158

Re: Stm32f103C8 External Dac

That is the R2R DAC.
Yes you can do it, sure. You may wire it to a port, ie. PortA or PortB, PA0-PA7 or PB0-PB7, and then send the DAC value to the PortA or PortB in a single write.
Mind the stm32 is a 3.3Volt device, thus the R2R output will be 0..3.28V max.
by Pito
Mon Jan 15, 2018 2:06 pm
Forum: Libraries & Hardware
Topic: Stm32f103C8 External Dac
Replies: 17
Views: 158

Re: Stm32f103C8 External Dac

Be more specific, what external DAC you want to use (if any)?
There are R2R DACs, 1-2-4-8..R DACs, I2C DACs, SPI DACs, parallel DACs, PWM DACs, etc..
by Pito
Mon Jan 15, 2018 1:52 pm
Forum: Libraries & Hardware
Topic: Stm32f103C8 External Dac
Replies: 17
Views: 158

Re: Stm32f103C8 External Dac

With 103C8 you may use

Code: Select all

analogWrite(pin, value);  // value 0 - 255

analogWrite(PA7, 189);

or

pwmWrite(pin value); // value 0 - 65535 
Works on specific pins.

You need a low-pass filter to get an analog value, however.

There is none hw DAC in 103C8.
by Pito
Mon Jan 15, 2018 1:37 pm
Forum: STM32generic
Topic: Virtual com port not showing????
Replies: 1
Views: 35

Re: Virtual com port not showing????

You have to upload a sketch with usb serial in order to see the COMxx, imho.
I got 407ZET6 and it worked fine (Win7).
UPload via STLink..
Or built in DFU - viewtopic.php?f=39&t=1976&p=26189&hilit ... 407#p26203
We do not have a bootloader for 407, afaik.
by Pito
Mon Jan 15, 2018 1:02 pm
Forum: Libraries & Hardware
Topic: Stm32f103C8 External Dac
Replies: 17
Views: 158

Re: Stm32f103C8 External Dac

Which external DAC, give us the link..
by Pito
Sun Jan 14, 2018 12:15 pm
Forum: Projects
Topic: F405 & F411 versions of the BluePill
Replies: 601
Views: 11214

Re: F405 & F411 versions of the BluePill

Then the option+1 is to have ready pads for buttons and leds on the bottom as well, when you decide to have current bottom the new top :) I've been becoming convinced it would be a good move :).. But it is up to you..
PS: you have to add the SWD header pins description on the bottom then..