Searching \ for '[PIC] Hard Drive Clock Finished' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/time.htm?key=clock
Search entire site for: 'Hard Drive Clock Finished'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Hard Drive Clock Finished'
2008\04\05@220451 by piclist

flavicon
face
Well, as finished as a hobby project ever can be.  I still want to try
building a small board that can fit inside the drive itself... that would
be perfect.

Anyways, thanks for all the help with the USART, general hardware tips,
config help and flash programming advice.

I put up a page about the construction and with pictures and video here...

http://www.ian.org/HD-Clock/

It was interesting to program.  I started with a PIC16F88 because that is
what I had a number of on hand.. but only having one timer was a problem
as well as the very slow math due to no hardware support.

Luckily I realised my old Warp-13 had a PIC18F252 in it, so I pried that
guy out of there and enjoyed having two 16 bit timers as well as the 8x8
multiplier and other speedups and features.

I had tried to use just a big loop with a single interupt for sensing the
platter rotation but although it seemed to work well, it glitched every
few seconds and so was unsuitable.  Just too much work going on in various
spots to be able to hit the targets.  At 5400 RPM the edge of the platter
is moving at 88 feet a second, so you need to be pretty accurate.

My only failure is I wanted to do PWM on the outputs so I could vary each
red, green and blue value to get more than 8 colors.  But I only have 1
PWM output and due to the work needed to deal with the LCD and calculating
the timings I just can't afford to sit in a tight loop bit banging out the
PWM code.

I am pondering setting up a 16F88 to just do the PWM output.. it should be
able to easily handle three of them at once and still read the input from
the 18F252.  Anyone have a good suggestion on how to communicate to the
16F88?  I have plenty of pins, but it needs to be FAST so I can tell it to
switch the lines on and off exactly when I want them, at the brightess I
want as well.

--
Ian Smith

2008\04\05@225142 by Jinx

face picon face
> http://www.ian.org/HD-Clock/

Cool. I'll have a proper look later though

> Anyone have a good suggestion on how to communicate to
> the 16F88?

I think 8-bit parallel with a "data ready" line. That line could be
bi-directional. For example, F88 starts with its end as i/p, and
waits for the data ready signal. F252 starts with its end as o/p.
Data ready is set high for valid data available, F252 switches to
i/p and the F88 switches to o/p, sending the line low, which the
F252 detects (perhaps use INT pins at each end). A pullup on
the line should avoid false positive pick-up

2008\04\05@232926 by Bob Axtell

face picon face
Jinx wrote:
>> http://www.ian.org/HD-Clock/
>>    
>
> Cool. I'll have a proper look later though
>
>  
>> Anyone have a good suggestion on how to communicate to
>> the 16F88?
>>    
>
> I think 8-bit parallel with a "data ready" line. That line could be
> bi-directional. For example, F88 starts with its end as i/p, and
> waits for the data ready signal. F252 starts with its end as o/p.
> Data ready is set high for valid data available, F252 switches to
> i/p and the F88 switches to o/p, sending the line low, which the
> F252 detects (perhaps use INT pins at each end). A pullup on
> the line should avoid false positive pick-up
>
>  
I missed the main message somehow. But I use interrupt-driven methods
that are quite reliable.
There are two methods: (1) clock and data (two pins), and the data pin
is reversible, or (2)
single-pin version (just one direction, but it could be adapted  for
two-way).  The second version
is normally used as a debug  tool (memory dump).

The first method is quite fast, transferring data at a rate up to 30uS
per bit. I use it to transfer 20bits
of data + 2 CRC bits, starting w/ 2 start bits, for a total of  24 bits.
30uS works if both PICs have a
fast clock, slower if 4mHz clock on one PIC.

The second method is a memory dump, starting from register 00 to end of
register memory. Each bit
requires 4mS, but uses a Manchester protocol, where a '1' is where over
50% of the bit time is spent
HIGH, and a '0' is where over 50% of the time is spent LOW. Its
advantage is that it is slow enough
for even a slow PC to extract and display the information. It requires  
a special program to extract, but
a small PIC could convert  the data to RS232 and drive a MAX232C with a
tiny PCB (suggested on
this list but not done yet).  This works especially well for small PICs
which don't work with the ICD2;
it acts as a great code debugging tool.

--Bob A

2008\04\05@233054 by Herbert Graf

flavicon
face

On Sat, 2008-04-05 at 22:04 -0400, spam_OUTpiclistTakeThisOuTspamian.org wrote:
> Well, as finished as a hobby project ever can be.  I still want to try
> building a small board that can fit inside the drive itself... that would
> be perfect.
>
> Anyways, thanks for all the help with the USART, general hardware tips,
> config help and flash programming advice.
>
> I put up a page about the construction and with pictures and video here...
>
> http://www.ian.org/HD-Clock/

That is AWESOME. Congrats. Only problem is we all hate you know, since
we all are going to spend time building one ourselves... :)

TTYL

2008\04\06@003337 by Jinx

face picon face
> I missed the main message somehow. But I use interrupt-driven
> methods that are quite reliable

Bob, Ian did say, in his message which you missed unfortunately,
fast in BIG letters and that he had plenty of spare pins. 8-bit parallel
would seem to be the easiest and fastest in that situation. I've done
it with PIC-to-Scenix data transfers for a pair of steppers and it's
wicked quick, just a couple of us



2008\04\06@004312 by Jinx

face picon face
> The first method is quite fast, transferring data at a rate up to 30uS
> per bit. I use it to transfer 20bits of data + 2 CRC bits, starting w/
> 2 start bits, for a total of  24 bits. 30uS works if both PICs have a
> fast clock, slower if 4MHz clock on one PIC.

I use a PIC RAM sniffer with an LCD using clock/data. Invaluable
debugger for what's really going on inside the PIC. Every home
should have one

> The second method is a memory dump.....
> ....for even a slow PC to extract and display the information

I have old DOS boxes around (286/386) that I'd love to put to
work doing chores like that. When I get around to it that is. The
sniffer above is OK, but to have all a PIC's RAM and registers
up on a monitor would be good. It wouldn't be too hard to either
send it as serial or in through LPT1:

2008\04\06@110738 by Christopher Head

picon face
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!
Assuming the 16F88 has a hardware PWM module (I don't know the part
personally), why not just use 8 pins on a single port of each device?
Have the F88 sit in a tight loop just doing MOVF PORT, W; MOVWF PWM; and
dump the desired brightness to the port on the 18F252.

You might get word tearing due to propagation delay now and then but
honestly, for the sake of the brightness of an LED, who cares? It'll
only be at the edges of a brightness transition anyway.

If you don't have 8 pins and don't need 256 levels of brightness,
substitute a smaller number. :)

Chris

.....piclistKILLspamspam@spam@ian.org wrote:
[snip]
|
| I am pondering setting up a 16F88 to just do the PWM output.. it
should be
| able to easily handle three of them at once and still read the input from
| the 18F252.  Anyone have a good suggestion on how to communicate to the
| 16F88?  I have plenty of pins, but it needs to be FAST so I can tell
it to
| switch the lines on and off exactly when I want them, at the brightess I
| want as well.
|
| --
| Ian Smith

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH+OcbiD2svb/jCb4RApMuAKCO8JG5j3PQUyicbMmSgxYfbF40rgCgnsVs
Hh+oaGhoa+q1gbVMR1fM6dI=
=hZt6
-----END PGP SIGNATURE-----

2008\04\06@154723 by Bob Axtell

face picon face
Jinx wrote:
>> The first method is quite fast, transferring data at a rate up to 30uS
>> per bit. I use it to transfer 20bits of data + 2 CRC bits, starting w/
>> 2 start bits, for a total of  24 bits. 30uS works if both PICs have a
>> fast clock, slower if 4MHz clock on one PIC.
>>    
>
> I use a PIC RAM sniffer with an LCD using clock/data. Invaluable
> debugger for what's really going on inside the PIC. Every home
> should have one
>
>  
Did you do it yourself? I have a couple of brand-new 4x24 LCD modules
with backlight.
My plan WAS to use an old DOS PC with a VT52 emulator program running
and have a tiny PCB pump
out the RAM from Manchester debug code inside the unit being developed.
Takes about 40 words..
But I like your ICD idea. Hmmm. maybe I could sell a few PCBs and make a
few USD,
if anyone uses USD anymore, and give away the code...
{Quote hidden}

I have a wonderful Fujitsu laptop with Win98 (NOT SE) and I use it for
stuff like that.
But it is limited on size of flash drives, everything. And, alas, it
CANNOT be updated
(according to Fujitsu). Works for days without coughing in DOS-ONLY
mode. For  a
while I had Laplink on it but I can't find a cheap program that will
reliably work on XP
on one end and DOS on the other...


-Bob

2008\04\06@185112 by Jinx

face picon face

> Did you do it yourself?

Yes, it's up on PIClist

http://www.piclist.com/techref/piclist/jinxlcdregmon.htm

I would like to make some changes, eg -

Pushbutton convert to ASCII/binary/decimal etc display
Auto-detect transmitting PIC
Bigger display

Someone (I think Bob B, Rolf or Dwayne) mentioned a one-wire
system they had

2008\04\06@190547 by piclist

flavicon
face
On Sun, 6 Apr 2008, Christopher Head wrote:
> Assuming the 16F88 has a hardware PWM module (I don't know the part
> personally), why not just use 8 pins on a single port of each device?
> Have the F88 sit in a tight loop just doing MOVF PORT, W; MOVWF PWM; and
> dump the desired brightness to the port on the 18F252.

The only problem with using the builtin PWM of the PIC is I need to
control three LED strings with each having a different level.  The 16F88
and 18F252 and most other similar chips only have one, sometimes two PWM
outputs which is sadly one or two less than I need.

But a tight loop toggling the bits on and off and reading 8 bits of the
port would work.  I could use two bits to indicate which output I was
selecting and the other 6 for 64 levels of brightness which will be fine
for my purpose of displaying meaningless color patterns. :-)

--
Ian

2008\04\06@192945 by Jinx

face picon face
BTW

http://www.piclist.com/techref/piclist/jinxlcdregmon.htm

A timing oversight - I found that a 48MHz USB PIC needs a
few NOPs in the transmit routine (as offered above) to give the
2520 a chance to store incoming and get back to data pick-up

The transmit routine could also of course include FSRs and
program/EEPROM locations

Generally now I have a pushbutton in the main loop or other
convenient wait place to send data on demand, using the bbdata
line as both button press detect and data transmit

Or the routine p2p is called to skip the button press and delay

(this example for an 8MHz 18F1320)

pic2pic  btfss   showram      ;wait for button release
        bra     $-2
        call    ms50         ;short debounce delay
        movlw   b'00101000'  ;i/p off, bbdata o/p on
        movwf   trisa

p2p      lfsr    fsr0,0x0000

d_loop   movlw   0x08
        movwf   temp4
        movf    indf0,w
        movwf   temp1
        call    send_d
        incfsz  fsr0l
        bra     d_loop
        movlw   b'10101000'  ;i/p on, bbdata o/p off
        movwf   trisa
        return

2008\04\06@194819 by Jinx

face picon face
Oh fudge

p2p      movlw   b'00101000'  ;i/p off, bbdata o/p on
        movwf   trisa

        lfsr    fsr0,0x0000

More... (looser matching)
- Last day of these posts
- In 2008 , 2009 only
- Today
- New search...