Hi Gav,
To make the boards I first draw out the schematic in Eagle. Then use the board tool to place and route the components. After that I print onto some transparency laser paper.
I use photoresist so have a UV box, developer and etchant ( ferric chloride )
It only took 30 mins from printing to having a fully etched board, then all I have to do is drill it.
The most expensive bit is the UV box which was about £100 from rapid electronics.
Theres a really helpful guide including a list of everything you need here :
http://picprojects.org.uk/projects/makepcb/index.htm
One thing I would add to that is DONT use carbide drills .. they are rubbish, way too brittle and VERY expensive...All you are drilling is pcb board. I use 1mm HSS drills which you can get from ebay, 10 for £1 rather than nearly £20 for carbide.... I have been using the same HSS bit for about a month now and its still razor sharp... HSS bits also allow for a small amount of flex...carbide dont..they snap way too easily
I looked at the tutorial on timers last night and did get a simple timer running ...
The timer code below was copied and modifed from Digital DIY to run on my 16f628a
I used the code for Timer1 and it seems to run perfectly
Code: Select all
'****************************************************************
'* Name : Milometer *
'* Author : ME!!!! *
'* Notice : Copyright (c) 2010 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 02/11/2010 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
Device 16F628A
Config INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_OFF, MCLRE_OFF, BODEN_ON, CP_OFF, LVP_OFF
LCD_DTPin = PORTB.4
LCD_RSPin = PORTB.2
LCD_ENPin = PORTB.3
LCD_Interface = 4
LCD_Lines = 2
LCD_Type = 0
All_Digital = True
DelayMS 150
Cls
Dim btnvar As Byte
Dim countm As Byte
Dim miles As Float
Dim uS As Word
Dim mS As Word
Dim S As Word
Dim mphd As Word
Dim mph As Word
Dim countd As Word
PORTA.1=0
Symbol GIE = INTCON.7 ' Global Interrupt Enable Bit
Symbol TMR1_Val = 64536 ' Set the initial value of TMR1
Symbol TMR1_mS = 1 ' Time period of TMR1
Symbol Timer1 = TMR1L.Word ' A special way of addressing both TMR1L and TMR1H with one register
Symbol TMR1_Enable = PIE1.0 ' TMR1 interrupt enable
Symbol TMR1_Overflow = PIR1.0 ' TMR1 overflow flag
Symbol TMR1_On = T1CON.0 ' Enables TMR1 to start incrementing
On_Interrupt Int_Sub
GoTo Initialization
Int_Sub:
GIE = 0
If TMR1_Overflow = 1 And TMR1_Enable = 1 Then
TMR1_Enable = 0
Timer1 = Timer1 + TMR1_Val
TMR1_Enable = 1
TMR1_Overflow = 0
mS = mS + TMR1_mS
If mS >= 1000 Then
mS = mS - 1000
S = S + 1
EndIf
EndIf
GIE = 1
Context Restore
Initialization:
TMR1_Enable = 0
INTCON.6 = 1 ' Peripheral Interrupts
T1CON.1 = 0 ' 1 = External clock from pin RC0/T1OSO/T1CKI (on the rising edge)
' 0 = Internal clock (FOSC/4)
'TRISC.0 = 1 ' If External clock, then set clock as an input
'HPWM 1,128,32000 ' Set TMR1's External Source
T1CON.2 = 1 ' 1 = Do not synchronize external clock input
' 0 = Synchronize external clock input
' When T1CON.1 = 0;
' this bit is ignored. Timer1 uses the internal clock when TMR1CS = 0.
T1CON.4 = 0 ' 11 = 1:8 prescale value
T1CON.5 = 0 ' 10 = 1:4 prescale value
' 01 = 1:2 prescale value
' 00 = 1:1 prescale value
Timer1 = TMR1_Val
TMR1_Enable = 1
TMR1_On = 1
GIE = 1
countm=0
countd=0
mphd=0
miles=0
main:
Repeat
Print At 1,1," ", "Miles ", Dec1 miles
Print At 2,1," ",Dec2, countm, " MPH" ' display mph using * .05682
Button PORTA.1,0,0,255,btnvar,0,nopress 'check for pulse from reed switch
countm=countm+1 'add to miles counter
countd=countd+1 ' add to mph counter
If countm=77 Then GoTo milesadd ' add 0.1 to miles covered
nopress:
Until S = 3
mphd=countd*77 /3
mphd=mphd *0.05682 ' find inches per second
S=0
countd=0 ' reset counter used for mph
GoTo main
milesadd:
miles=miles+0.1
countm=0
GoTo main