Category Archives: hacking

jackomo

Posted on 20 June 2006 by jakilevy

HPWM

from micro code studio help option:

HPWM PRO STD

HPWM Channel,Dutycycle,Frequency

HPWM run continuously in the background while the program is doing other things. Channel specifies which hardware PWM channel to use. Some devices have 1, 2 or 3 PWM channels. On devices with 2 channels, the Frequency must be the same on both channels. Dutycycle specifies the on/off (high/low) ratio of the signal. It ranges from 0 to 255, where 0 is off (low all the time) and 255 is on (high) all the time. A value of 127 gives a 50% duty cycle (square wave). Frequency is the desired frequency of the PWM signal. Not all frequencies are available at all oscillator settings. The lowest frequency at 4MHz is 245Hz. The highest frequency at any oscillator speed is 32767Hz.

The lowest usable HPWM Frequency at each oscillator setting is shown in the following table:

OSC 14-bit core and 18Cxxx 17Cxxx
4MHz 145Hz 3907Hz
8MHz 489Hz 7813Hz
10MHz 611Hz 9766Hz
12MHz 733Hz 11719Hz
16MHz 977Hz 15625Hz
20MHz 1221Hz 19531Hz
24MHz 1465Hz 23438Hz
33MHz 2015Hz 32227Hz
40MHz 2442Hz na

Some devices, such as the PIC18C452, have alternate pins that may be used for HPWM. The following DEFINEs allow using these pins:

DEFINE CCP1_REG PORTC ‘Hpwm 1 pin port
DEFINE CCP1_BIT 2 ‘Hpwm 1 pin bit
DEFINE CCP2_REG PORTC ‘Hpwm 2 pin port
DEFINE CCP2_BIT 1 ‘Hpwm 2 pin bit

The following DEFINEs specify which timer, 1 or 2, to use with PWM channel 2 and PWM channel 3 for the PIC17C7xx devices. The default is timer 1 if no DEFINE is specified.

DEFINE HPWM2_TIMER 1 ‘Hpwm 2 timer select
DEFINE HPWM3_TIMER 1 ‘Hpwm 3 timer select

Example

HPWM 1,127,1000 ‘ Send a 50% duty cycle PWM signal at 1kHz
HPWM 1,64,200   ‘ Send a 25% duty cycle PWM signal at 2kHz

See Also

PWM

Copyright © 2001 microEngineering Labs, Inc.
All rights reserved.

Sphere: Related Content

jackomo

Posted on 14 June 2006 by jakilevy

Controlling a DC Motor

Here is a good article on H-Bridges

I am using an allegro motor driver
Click for Datasheet

PIC BASIC PRO CODE:

DEFINE OSC 4
start:
INCLUDE “modedefs.bas”
‘break

OUTPUT PORTD.0
INPUT PORTD.2 ‘Switch 1
INPUT PORTB.0
i var byte
‘Wait .5 second

‘BLINK AN LED to Test the PIC
high portd.0
pause 500
low portd.0
pause 500
high portd.0
pause 500
low portd.0
Pause 500

main:
‘IF Switch 1 is pressed
if portd.2 = 1 then

‘test LED’S
low portb.7
higH PORTD.0

‘TURN MOTOR 1 – REVERSE
HIGH PORTD.1
‘For i = 0 to 255 step 1
‘FOR a motor – 127 is 0 point
‘128 is SLOW fwd … 255 is fast fwd
‘126 is SLOW REV … 0 fast rev

‘PWM Pin,Duty,Cycle
PWM PORTD.1,0, 10
next
endif
‘If Switch 1 is NOT pressed – TURN MOTOR OTHER WAY
if portd.2 = 0 then

‘TEST LED
low PORTD.0

‘TURN MOTOr 1 – FWD
‘For i = 255 to 0 step -1
‘PWM Pin,Duty,Cycle
PWM PORTD.1,255, 10
next
endif

GoTo main

Sphere: Related Content

jackomo

Posted on 07 June 2006 by jakilevy

Fixing the tape

Today we modified the first VHS cassette for use in the project. Because our first version had open spools of tape, we had to thread the tape through the whole VCR each time. By modifying the VHS cassette, we were able to spend much less time fumbling with the tape and more time on the VCR itself.

The main challenge in adding more VCR’s to the project is maintaining tape tension. If we can find a way to maintain the tension in the tape, we could very easily add more VCR’s with our newly modified VHS cassette holder.

Sphere: Related Content

jackomo

Posted on 27 May 2006 by jakilevy

Networked VCR’s – VIDEO

This is what the system will look like more or less –
VHS Hack
Please be patient while it loads…

Here is a PICTURE:
VCR Hackery

SCHEMATIC

For the first stage of building, we took apart a VHS tape and put one reel in VCR1.
The 2nd reel went into VCR2.

Then, we pressed play on VCR2. As the video shows, the tape moves from one VCR to the next.

In this video segment, the “damage” portion of the system is replaced by a white piece of paper

Sphere: Related Content

jackomo

Posted on 23 May 2006 by jakilevy

Networked VCR’s

like audio casette tapes and other analog technology, the VCR is on its way out.
with the rise of DVR’s (digital video recorders) DVD’s , and other digital technology, the VCR is now a quaint thing of the past – like Vinyl Records, VHS tapes are now acquiring a nostalgic status.

for my upcoming project, I will network 4 VCR’s – sending the VHS tape from one VCR to another. as the VHS tape travels from VCR to VCR, the VHS tape will degrade in quality and decompose mirroring the disappearance of analog technology from our culture

see:
Death Of VHS
Another Article

Sphere: Related Content

jackomo

Posted on 22 May 2006 by jakilevy

VCR Printer

i am combining a VCR and a printer. the printer will be the mechanism to move the tape back and forth. as it moves through the printer, the tape will get damaged.

perhaps i can find a way to print onto the VHS tape with another mecahnism and then play back that product. perhaps i can find a way to relay the tape through several VCR’s and affect the tape in each stage , damaging it slightly until it gets to the last VCR and plays a whole different permutation of the first stage. by moving the tape through phases and stages of damage, we see the rapid deterioration of the tape in front of our eyes.

Sphere: Related Content

jackomo

Posted on 17 May 2006 by jakilevy

VCR Hack

i took a look at a VCR today – it was quite nice to see the magnets, motors, and machinery move all together. once i realized that was all switches moving motors, i started looking at ways to trigger the switches. nothing really hit me, so i started soldering wires to extend the switches to outside the VCR.

mechanics have quite their own aesthetic – i found it very interesting to just watch how the tape moved through the whole machine. it did make a noise, though and now i remember back to the ennio morricone experience i saw in edinburgh. they had a tape run through a whole mechanic mechanism to make the sound of crickets – it was as simple as that – a tape strung through a mechanical device.

i also think of vinyl records being scratched very gently – many vinyls are now being sold for $2 or just being given away – the analog doesn’t have a permanent home in this quickly moving digital age –

digital information takes up less space – it can live in virtual hard drives and does not demand the same physical presence as its analog counterpart. roadtrips consisting of books of cd’s have been compressed into an iPod. i do not necessarily lament the analog, yet the analog is now nostalgic.

in a purely digital world, continuity and mechanics are hidden aspects of this environment.

Sphere: Related Content