Search found 44 matches

by octavio
Tue Nov 07, 2017 11:50 am
Forum: Code snipplets
Topic: dmx input
Replies: 0
Views: 44

dmx input

Sample code to read a dmx universe,using a dmx to serial adapter and the usart3 rx pin on the blue pill. typedef struct usart_reg_map { __io uint32 SR; /**< Status register */ __io uint32 DR; /**< Data register */ __io uint32 BRR; /**< Baud rate register */ __io uint32 CR1; /**< Control register 1 *...
by octavio
Mon Nov 06, 2017 5:39 pm
Forum: Libraries & Hardware
Topic: [SOLVED] spi remap
Replies: 9
Views: 755

Re: [SOLVED] spi remap

It works but the spi library still configures the default spi pins making it useless for other purposes.how can i tell to the spi lib to use the remaped pins instead?
by octavio
Sat Oct 07, 2017 7:54 pm
Forum: General discussion
Topic: change serial interrupt routine
Replies: 7
Views: 203

Re: change serial interrupt routine

Thanks,i did the same as Riva and it seems to work.
by octavio
Thu Oct 05, 2017 9:29 pm
Forum: General discussion
Topic: change serial interrupt routine
Replies: 7
Views: 203

Re: change serial interrupt routine

Code: Select all

void usart_init(usart_dev *dev) {
    rb_init(dev->rb, USART_RX_BUF_SIZE, dev->rx_buf);
    rb_init(dev->wb, USART_TX_BUF_SIZE, dev->tx_buf);
    rcc_clk_enable(dev->clk_id);
    nvic_irq_enable(dev->irq_num);
}
it seems that the vector is hardcoded.
by octavio
Thu Oct 05, 2017 9:26 pm
Forum: General discussion
Topic: change serial interrupt routine
Replies: 7
Views: 203

Re: change serial interrupt routine

https://github.com/rogerclarkmelbourne/ ... usart_f1.c

Code: Select all

void __irq_usart2(void)
Not sure if this is the code,but it seems is declared the normal way.
by octavio
Thu Oct 05, 2017 9:19 pm
Forum: General discussion
Topic: change serial interrupt routine
Replies: 7
Views: 203

Re: change serial interrupt routine

" there may be an attachInterrupt method"
I did not found it.
by octavio
Thu Oct 05, 2017 6:34 pm
Forum: General discussion
Topic: change serial interrupt routine
Replies: 7
Views: 203

change serial interrupt routine

Hello,how can i declare a interrupt routine for USART3 (Serial2).
by octavio
Tue Sep 19, 2017 12:08 am
Forum: General discussion
Topic: Overactive interrupt triggering using internal pullups
Replies: 42
Views: 1579

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: 1579

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: 1579

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.