Search found 65 matches

by PinkInk
Mon Jul 14, 2014 3:09 pm
Forum: General Discussion and Questions
Topic: Quest for peek and poke ...
Replies: 0
Views: 3312

Quest for peek and poke ...

I'm trying to implement PWM with the help of in-line assembler, on this quest I've kind of decided that it's sanest to minimise the assembler to basic peek and poke and "do the logic"/heavy lifting in uPy. However I'm running into hard-faults, which I *think* I've substantiated shouldn't be occurrin...
by PinkInk
Mon Jul 14, 2014 2:49 pm
Forum: Hardware Projects
Topic: dead bug dc motor driver
Replies: 3
Views: 11675

Re: dead bug dc motor driver

Jon, many thanks - I'm trying desperately to avoid C, for various (personal) reasons, but I've had a look through your sample code and it verifies what I've learnt (from Google) needs to be done to setup and control PWM (and substantiated by peering into and manipulating LED 4's associated GPIO and ...
by PinkInk
Sun Jul 13, 2014 4:32 pm
Forum: Development of MicroPython
Topic: Assembler, GPIO, 31bit integers?
Replies: 4
Views: 6781

Re: Assembler, GPIO, 31bit integers?

Thanks, I reported the movwt issue ... uPy appears to support a subset of the commands required for these operations i.e. it supports mov and movt ... but the limitations of what it currently exposes come up pretty quickly (particularly in relation to absence of more useful variants of commands that...
by PinkInk
Sat Jul 12, 2014 3:51 pm
Forum: Development of MicroPython
Topic: Assembler, GPIO, 31bit integers?
Replies: 4
Views: 6781

Assembler, GPIO, 31bit integers?

*Somewhere* I think I read that micropython implements 31 bit integers, but I can't recall where, is this correct? (recall something about the most significant bit indicating to the gc whether it's a pointer or a number) In pursuit of a temporary PWM fix, via embedded assembler, I am trying to push ...
by PinkInk
Fri Jul 11, 2014 6:30 pm
Forum: Hardware Projects
Topic: dead bug dc motor driver
Replies: 3
Views: 11675

dead bug dc motor driver

This mornings work, dumb h-bridge dc motor driver skin and code module;

Image

This afternoons work; inline assembler tutorial and lots of googe'ling ... but no PWM speed control, yet ...
by PinkInk
Sun Jul 06, 2014 4:39 pm
Forum: Hardware Projects
Topic: TinderBot
Replies: 3
Views: 5704

Re: TinderBot

That's so crude and wrong, it's fantastic ... ';o)

<subscribe>
by PinkInk
Sun Jul 06, 2014 8:14 am
Forum: General Discussion and Questions
Topic: AMP Skin?
Replies: 3
Views: 4401

Re: AMP Skin?

Connecting the DAC direct into a piezo buzzer also works, and is very quiet ;o) Note this thread - http://forum.micropython.org/viewtopic.php?f=6&t=193 - ADC outputs 12bit values, DAC takes a buffer of 8bit values - @pfalcon says that the ADC will just drop the low-byte when writing into a bytearray...
by PinkInk
Sat Jul 05, 2014 4:32 pm
Forum: MicroPython pyboard
Topic: pwm
Replies: 8
Views: 9706

pwm

pyb module has a pyb.pwm function, and many of the pyboard pins are circled i.e. indicating support for pwm ... but there's no documentation on micropython.org. pyb.pwm takes two int arguments, and anecdotal evidence points to it being used by pyb.Servo and pyb.LED on LED4, but otherwise it's a bit ...
by PinkInk
Tue Jul 01, 2014 9:58 am
Forum: MicroPython pyboard
Topic: adc.read_timed buffer problem ...
Replies: 6
Views: 11610

Re: adc.read_timed buffer problem ...

I guess a generator is a more microPythonic (aka efficient) way of doing it? i.e. >>> def fillbuf(l): ... for i in range(l): yield 0 ... >>> import array >>> buf=array.array('H',fillbuf(10)) >>> buf array('H', [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) Which could theoretically be appended to the initialiser o...
by PinkInk
Mon Jun 30, 2014 4:33 am
Forum: MicroPython pyboard
Topic: adc.read_timed buffer problem ...
Replies: 6
Views: 11610

Re: adc.read_timed buffer problem ...

Ahhh ... prefilling an array seems to work, bingo?! >>> import pyb,array >>> adc=pyb.ADC(pyb.Pin.board.X5) >>> buf=array.array('H') >>> for i in range(10): buf.append(0) ... >>> adc.read_timed(buf,10) 20 >>> buf array('H', [3666, 3664, 3673, 3671, 3671, 3669, 3672, 3671, 3666, 3671]) >>> (X5 wasn't ...