The Beacon
Schematic
Click image to zoom.
What is Included
Click SKU code in table below to locate particular part.
Click images to zoom.
How to power it-up
This project requires 3~5V. You can use batteries or power adapter from
an appliance like charger, network router, phone answering machine, etc.
Other possibilities:
- Pack of 3 alkaline cells supplies approx. 4.5V fuly charged.
- Pack of 4 NiCD cells supplies approx. 5V fuly charged.
- 3.7V lithium cell (e.g. 18650 type) supplies approx. 4.2V fully charged.
- 3V lithium cell (e.g. 2032) will work but LEDs will be faint.
Do not use higher voltage than 5.5V or you may damage the chip !
Assembly Steps
- Cut the universal PCB into 8x8 pieces.
- Install DIP14 socket. You may place a two-wire cable under it to lock the cable and prevent tear.
- Install 8 resistors and leave their leads longer.
- Install wire loop around PCB, this will be GND (not shown).
- Install LEDs from the bottom. Bend cathodes and solder them onto GND loop.
- Bend the leads of resistors and make connections (blue in the picture).
- Install 100nF capacitor between VDD and VSS of U1.
- Install a jump from LED7 anode to R7.
- Install power leads.
- Insert programmed PIC.
Click images to zoom.
Source Code
;Beacon8 w/ PIC16F526
;dipmicro electronics, 2009
#include "P16F526.INC"
__config _MCLRE_OFF & _IOSCFS_4MHz & _IntRC_OSC_RB4 & _CP_OFF & _WDTE_OFF
#define LED1 PORTC,0
#define LED2 PORTC,1
#define LED3 PORTC,2
#define LED4 PORTC,4
#define LED5 PORTC,5
#define LED6 PORTB,4
#define LED7 PORTC,3
#define LED8 PORTB,1
#define DELAY_VALUE 100
PAUSE macro
movlw DELAY_VALUE
call delay
endm
radix dec
cblock 0x10 ;variables
delayCount
endc
org 0
goto start
;----------------------------------------------------------------------------
; delay
;----------------------------------------------------------------------------
delay:
movwf delayCount
delay1:
clrw
delay2:
nop ;1c
decfsz W,f ;1c
goto delay2 ;2c
decfsz delayCount,f
goto delay1
retlw 0
;----------------------------------------------------------------------------
; main program
;----------------------------------------------------------------------------
start:
banksel 0
clrw
movwf ADCON0
movwf CM1CON0
movwf CM2CON0
movlw b'11001000'
tris PORTB
movlw b'11000000'
tris PORTC
movlw b'11011000'
option
bcf LED1
bcf LED2
bcf LED3
bcf LED4
bcf LED5
bcf LED7
main:
bsf LED8
bcf LED6
PAUSE
bsf LED1
bcf LED7
PAUSE
bsf LED2
bcf LED8
PAUSE
bsf LED3
bcf LED1
PAUSE
bsf LED4
bcf LED2
PAUSE
bsf LED5
bcf LED3
PAUSE
bsf LED6
bcf LED4
PAUSE
bsf LED7
bcf LED5
PAUSE
goto main
end