giovedì 2 maggio 2013

Almost every Raspberri Pi owner uses it without a monitor/keyboard attached to it... One simple option is controlling the (mini)computer by ssh or directly by an iphone (thanks to xbmc + airplay, GREAT invention!). Anyway, after listening hour of justin bieber music you could think... "and now, how the hell I can turn this off?" after some moments of hard-thinking you end up with the simplest solution: unplug the power, no matter if the (poor) system tells you every time "the system was not shut down properly".

Next move: use google to search for "raspberry power off button". One of the most interesting site you could find is: http://www.3cc.org/blog/2013/01/raspberry-pi-shutdown-switch-safely-turning-off-the-pi/. Perfect! i will use the code reported there to turn off my very special media player! let me see the code... 







                                                                                         

scheda PICDEM FS USB compatibile

Volendo imparare a usare il controller USB dei microcontrollori Microchip, ho iniziato a guardarmi intorno per qualche esempio di applicazione. Ho trovato un prodotto della stessa Microchip, il PICDEM FS USB, che monta un microcontrollore della serie 18f4550 e permette di utilizzare le funzionalità offerte da questo a partire da un po' di esempi da usare con MPLAB.

Il problema di questa scheda è il costo, così ho deciso di costruirmi un clone da solo.

sabato 23 marzo 2013

How to use 4 HARDWARE PWM on a PIC @ 50hz


simplified block diagram of PWM operation 
(from PIC 16F1509 datasheet)
Do you need to use a servomotor with a PIC (with the PWM modules integrated in it)? it could be a problem, since servomotor works around 50Hz, which is a really-slow frequency.

I'll use the PIC 16F1509, teach you the basics, so you can arrange the code to other PICs too.

My new project (lucky me) needs 4 hardware implemented PWM source, but I noticed that the pic microcontrollers usually have just 2 or 3 PWM modules. then I discovered this useful page: http://www.microchip.com/maps/Microcontroller.aspx which allows you to perform a parametric search over the complex pic-world. I ended up with the PIC 16F1509, which seems to be perfect: USART, 4PWM, comparator, 18 I/O pins, ADCs AND software selectable frequency for the internal oscillator!


domenica 9 settembre 2012

Topological skeleton

For my final work I needed to "skeletonize" an image. 

If you don't know what I'm talking about, you can see the wikiedia page:

en.wikipedia.org/wiki/Topological_skeleton
and
en.wikipedia.org/wiki/Straight_skeleton

I looked for a SIMPLE code, just to know i fthis solution could work on my images and... I didn't find it...

martedì 3 maggio 2011

Polifemo / monocular

Dopo un periodo di lunga assenza, oggi vorrei descrivere un progetto che ho realizzato nei ritagli di tempo (che sono veramente pochi ultimamente). Siccome il progetto è stato riadattato per un esame universitario, quella che segue è una relazione molto "accademica". 

Lo scopo del progetto è stato elaborare e costruire hardware e software per muovere automaticamente una webcam, in modo che essa segua lo spostamento di un oggetto. 











domenica 20 marzo 2011

Interfaccia mouse ottico e PIC


se volete linkare, copiare, usare ecc ecc quello che c'è scritto in questo articolo potete farlo, ma citando l'autore.
non mi assumo responsabilità per danni a mouse, robot o alle vostre persone XD
e SI, sono io che ho pubblicato questo articolo anche su grix, quindi non l'ho copiato, è roba mia!

OK, COMINCIAMO! :)
Per un robot che sto costruendo avevo bisogno di un sensore di movimento preciso ed economico... cosa meglio di un mouse ottico? solo che il pic che stavo usando non ha controller usb...

lunedì 14 marzo 2011

Interfacing an optical mouse (USB) with a PIC (which doesn't have USB CONTROLLER!)

se preferite la versione in italiano la trovate nel post precedente :p
if you want to copy, share, use etc. etc. all or part of this article you CAN DO IT, BUT please cite me and share the link to this article.
I'm not taking any responsibility for any kind of damage to your mouse, your PIC or yourselves XD
and yes, I posted this article on grix.com too (written in Italian).

OK, LET'S GO! :)
I needed a cheap (and accurate) motion sensor... What could be better than an optical mouse for the job? BUT... my PIC doesn't have a usb controller (and I'm cheap, so I don't want to buy a new one :p ) so I had to do things my way... :)

lunedì 7 marzo 2011

PWM seriale pic 16F628

Per un progetto che vedrete prossimamente, avevo bisogno di generare un segnale PWM dalla seriale del pc... il problema principale è che mi serviva di continuare a generare lo stesso segnale anche dopo aver staccato il cavo di collegamento al pc. Bene, basta un pic, un max232 e una manciata di componenti a contorno.