Search found 73 matches

by manitou
Wed Sep 23, 2015 11:16 pm
Forum: MicroPython pyboard
Topic: 1-wire library and pyb.freq()
Replies: 16
Views: 14870

Re: 1-wire library and pyb.freq()

Here is snapshot of analyzer with ow.write_byte(0xa5) onewire.png The critical timing is that writing a 1-bit is supposed to start with a low pulse of < 15 us. At 168mhz, the python low pulse is 15.25us. The spec says the receiver sampling window is 30us, so the one-wire device will read the value s...
by manitou
Wed Sep 23, 2015 8:07 pm
Forum: MicroPython pyboard
Topic: 1-wire library and pyb.freq()
Replies: 16
Views: 14870

Re: 1-wire library and pyb.freq()

I need to do some tests with the analyzer, but looking at the one-wire spec and then at onewire.py, it appears that in addition to pyb.udelay(), the driver is trying to take into account the delay of each micropython statement (say about 5us) in order to arrive at the cumulative delay expected by th...
by manitou
Fri Sep 18, 2015 12:02 pm
Forum: MicroPython pyboard
Topic: USART2
Replies: 12
Views: 9869

Re: USART2

pagano.paganino wrote: USART2 is on 84MHz for set to 4MHz is correct set prescaler to 21?
As I read chapter 7 of ref manual, USART2 is on APB1 which runs at 42MHz. you could verify your 4MHz with scope or analyzer.
by manitou
Mon Sep 14, 2015 9:13 pm
Forum: MicroPython pyboard
Topic: Read ADC using DMA
Replies: 20
Views: 26380

Re: Read ADC using DMA

if you don't require asynchronous ADC acquisition (DMA), i think that you could run the ADC in continuous mode, and the C firmware could test EOC and save the ADC values before the next sample is ready. Thus you would be acquiring the data as fast as the ADC samples became available. I plan to do s...
by manitou
Mon Sep 14, 2015 5:35 pm
Forum: MicroPython pyboard
Topic: Can anyone explain this?
Replies: 5
Views: 4780

Re: Can anyone explain this?

pythoncoder wrote:It resulted from my arbitrary choice of LED 4 for testing and it works as expected with other LED's.
Ahhhh, interesting. LED4's PWM period is 10ms. QED
by manitou
Sun Sep 13, 2015 9:40 pm
Forum: MicroPython pyboard
Topic: Can anyone explain this?
Replies: 5
Views: 4780

Re: Can anyone explain this?

Have you discovered anything?

I know I should try this myself ... but what happens if you use udelay() instead of delay()? delay() uses sleep mode (WFI) to pass the time, udelay() is a spin-wait ...
by manitou
Sun Sep 06, 2015 4:42 pm
Forum: Drivers for External Components
Topic: IR remote transmitter/receiver for Sony
Replies: 0
Views: 6426

IR remote transmitter/receiver for Sony

At the following https://github.com/manitou48/pyboard/tree/master/IRremote are classes for an IR transmitter and receiver for Sony. One timer is used for the 40khz-PWM IR transmission, driving an IR LED. A second timer captures the rise and fall of the IR receiver (e.g. TL1838 or GP1UX311QS). Since ...
by manitou
Sun Aug 09, 2015 1:48 pm
Forum: MicroPython pyboard
Topic: Read ADC using DMA
Replies: 20
Views: 26380

Re: Read ADC using DMA

if you don't require asynchronous ADC acquisition (DMA), i think that you could run the ADC in continuous mode, and the C firmware could test EOC and save the ADC values before the next sample is ready. Thus you would be acquiring the data as fast as the ADC samples became available. I plan to do so...
by manitou
Sat Aug 08, 2015 3:54 pm
Forum: MicroPython pyboard
Topic: Read ADC using DMA
Replies: 20
Views: 26380

Re: Read ADC using DMA

The ADC DMA hardware has a circular buffer option. You could provide a buffer and start the continuously running ADC, and then read the buffer (as it is being continuously updated) at your leisure. You could also be notified (you'd need a callback) or poll the EOC bit to see if a cycle through your ...
by manitou
Fri Aug 07, 2015 3:40 pm
Forum: MicroPython pyboard
Topic: Read ADC using DMA
Replies: 20
Views: 26380

Re: Read ADC using DMA

I have improved the ADC.read_timed() function so that you can go up to about 750kHz sample rate while retaining precision (with 12 bit resolution, 15 cycle conversion time). The problem was that the ADC was being turned off and then back on between each sample! So now it's just turned on at the sta...