Search found 37 matches

by octavio
Tue Sep 19, 2017 12:08 am
Forum: General discussion
Topic: Overactive interrupt triggering using internal pullups
Replies: 42
Views: 1233

Re: Overactive interrupt triggering using internal pullups

It was a multilayer ceramic capacitor,but there was a 4cm wire betwen the capacitor and the port pin and another 4cm betwen the capacitor and the board gnd.It seems that this wire has a good radiofrecuency coupling with the serial line.
by octavio
Mon Sep 18, 2017 10:55 pm
Forum: General discussion
Topic: Overactive interrupt triggering using internal pullups
Replies: 42
Views: 1233

Re: Overactive interrupt triggering using internal pullups

Problem solved,it was electrical noise (problably caused by the serial line).There was a 4cm thin wire betwen the capacitor and the pin,this wire was a enought good antenna to make the chip (an me too) crazy. I solved the problem adding a 3k resistor in series with the pin and as close as possible t...
by octavio
Mon Sep 18, 2017 10:05 pm
Forum: General discussion
Topic: Overactive interrupt triggering using internal pullups
Replies: 42
Views: 1233

Re: Overactive interrupt triggering using internal pullups

I mean that the ISR code reads the pin value using "digitalread()" and compares with the value stored in the previous interrupt ,and sometimes is the same,so no interrupt should occur but it happens.And this problem happens while using "Serial.print()", else it works fine.
by octavio
Mon Sep 18, 2017 8:48 pm
Forum: General discussion
Topic: Overactive interrupt triggering using internal pullups
Replies: 42
Views: 1233

Re: Overactive interrupt triggering using internal pullups

I get aditionals interrupts without pin changing value, when the button is released and the pin voltage goes slowly (about 200ms) from 0 to 3.3v.Since the interrupt happens without a pin status change,it should be a bug ,not electrical noise. About volatile: the value is not written out of the ISR a...
by octavio
Mon Sep 18, 2017 6:22 pm
Forum: General discussion
Topic: Overactive interrupt triggering using internal pullups
Replies: 42
Views: 1233

Re: Overactive interrupt triggering using internal pullups

I have disabled the internall pullup and conected a 4k external pullup,problem continues.
by octavio
Sun Sep 17, 2017 11:33 pm
Forum: General discussion
Topic: Overactive interrupt triggering using internal pullups
Replies: 42
Views: 1233

Re: Overactive interrupt triggering using internal pullups

The pullups values are similar to those found in other microcontrollers (atmega,xmega) and they work without problem in those microcontrollers,with or without filters if the wires are not too large.And 50k seems a suitable value,sometimes i have used 1M external resistors to reduce current consumpti...
by octavio
Sun Sep 17, 2017 8:25 pm
Forum: General discussion
Topic: Overactive interrupt triggering using internal pullups
Replies: 42
Views: 1233

Re: Overactive interrupt triggering using internal pullups

The code below counts when button is pressed,the button is connected to a pin with a 10uf capacitor in parallel to filter posible noise,only the internal pullup is used,and it works ok if i press the button betwen calls to " Serial.println(f1);" but if i reduce the delay to 100ms then it counts abou...
by octavio
Thu Sep 14, 2017 1:49 pm
Forum: Libraries & Hardware
Topic: library for driving leds with stm32f103
Replies: 11
Views: 290

Re: library for driving leds with stm32f103

To avoid latency problems the irq priority is set higher than default nvic_irq_set_priority(NVIC_DMA_CH1,14); so the ISR will run even if there is another ISR with low priority active.The timer controls dma transfer and dma calls the ISR when half buffer is written,so there is some time until the ot...
by octavio
Wed Sep 13, 2017 11:27 pm
Forum: Libraries & Hardware
Topic: library for driving leds with stm32f103
Replies: 11
Views: 290

Re: library for driving leds with stm32f103

The ISR fills the DMA buffer faster than its being sent ,so speed is limited by the 800kbps(can work also at 1Mbps) used by the ws2812,writting 4 strips at a time speed up x4. If you want to know how many cpu clks takes to process a pixel ,you can look at the assembly output and count,(i can't do th...
by octavio
Wed Sep 13, 2017 12:11 pm
Forum: Libraries & Hardware
Topic: library for driving leds with stm32f103
Replies: 11
Views: 290

Re: library for driving leds with stm32f103

110 = Data "1" bit
100 = Data "0" bit
there is also the posibility to encode like this:
npk=4
1100 = Data "1" bit
1000 = Data "0" bit
npk=5
11000 = Data "1" bit
10000 = Data "0" bit
to reduce the transfer speed if needed.