; ATmega328.asm
; version 2.2 Jan 16, 2013 - Works with original DDS kit using ATmega328P

; cd ~/Desktop/www/kitsandparts.com/DDS_VFO/DDS-1/
; avra ATmega328.asm
; avrdude -P usb -p m328p -c avrispv2 -U lfuse:w:0xD7:m ; default is 0x62 - clock stuff
; avrdude -P usb -p m328p -c avrispv2 -U hfuse:w:0xD9:m ; default is 0xD9 - no reprogramming required, EEPROM preserved
; avrdude -P usb -p m328p -c avrispv2 -U efuse:w:0xFC:m ; default is 0xFF - brownout detection
; avrdude -P usb -p m328p -c avrispv2 -v -B5 -U lfuse:w:0xD7:m -U hfuse:w:0xD9:m -U efuse:w:0xFC:m -U flash:w:ATmega328.hex

.include "m328Pdef.inc"

.equ LCD_DRS=	PC0
.equ LCD_E	=	PC1
.equ LCD_CP	=	PC2
.equ LED		=	PC3

.equ DDSclock  = PD1
.equ DDSdata   = PD5
.equ DDSenable = PD0

.equ PHASE =PD4
.equ STATE =PD2

.def temp1 =r16
.def temp2 =r17
.def temp3 =r18
.def temp4 =r19
.def temp5 =r20
.def temp6 =r21
.def StepRate =r22
.def press =r23
.def delay =r24
.def encoder =r25
.def	XL	= r26
.def	XH	= r27
.def	YL	= r28
.def	YH	= r29
.def	ZL	= r30
.def	ZH	= r31

.dseg
.org SRAM_START
LCDrcve0: .byte 8 ; buffer for decimal freq readout
rcve0: .byte 4    ; buffer for DDS freq numbers
freq0: .byte 4    ; buffer for 1 freq numbers
freq1: .byte 4    ; buffer for 10 freq numbers
freq2: .byte 4    ; buffer for 100 freq numbers
freq3: .byte 4    ; buffer for 1,000 freq numbers
freq4: .byte 4    ; buffer for 10,000 freq numbers
freq5: .byte 4    ; buffer for 100,000 freq numbers
freq6: .byte 4    ; buffer for 1,000,000 freq numbers
freq7: .byte 4    ; buffer for 10,000,000 freq numbers

.cseg ;This tells the assembler that what follows is code, and goes in ROMspace
.org 0
 rjmp RESET
.org INT0addr ; External Interrupt Request 0
 rjmp	EXT_INT0
.org INT1addr ; External Interrupt Request 1
 rjmp	EXT_INT1
.org PCI0addr	; Pin Change Interrupt Request 0
 reti
.org PCI1addr	; Pin Change Interrupt Request 1
 reti
.org PCI2addr	; Pin Change Interrupt Request 2
 reti
.org WDTaddr ; Watchdog Time-out Interrupt
 reti
.org OC2Aaddr ; Timer/Counter2 Compare Match A
 reti
.org OC2Baddr ; Timer/Counter2 Compare Match A
 reti
.org OVF2addr ; Timer/Counter2 Overflow
 reti
.org ICP1addr ; Timer/Counter1 Capture Event
 reti
.org OC1Aaddr ; Timer/Counter1 Compare Match A
 reti
.org OC1Baddr ; Timer/Counter1 Compare Match B
 reti
.org OVF1addr ; Timer/Counter1 Overflow
 reti
.org OC0Aaddr ; TimerCounter0 Compare Match A
 reti
.org OC0Baddr ; TimerCounter0 Compare Match B
 reti
.org OVF0addr ; Timer/Couner0 Overflow
 rjmp	OVF0
.org SPIaddr ; SPI Serial Transfer Complete
 reti
.org URXCaddr ; USART Rx Complete
 reti
.org UDREaddr ; USART, Data Register Empty
 reti
.org UTXCaddr ; USART Tx Complete
 reti
.org ADCCaddr ; ADC Conversion Complete
 reti
.org ERDYaddr ; EEPROM Ready
 reti
.org ACIaddr ; Analog Comparator
 reti
.org TWIaddr ; Two-wire Serial Interface
 reti
.org SPMRaddr ; Store Program Memory Read
 reti

RESET: ;init everything here
	ldi		temp1,low(RAMEND)
	out		SPL,temp1			; Set stack pointer to last internal RAM location
	ldi		temp1,high(RAMEND)
	out		SPH,temp1

;init ports
	ldi		temp1,$0F
	out		DDRC,temp1		;make all 4 PC0-PC3 pins an output
	cbi		PORTC,LCD_E		;set LCD_E low
 	cbi		PORTC,LCD_CP	;set LCD_CP low
	sbi		PORTC,LED			;turn LED off
	ldi		temp1,$23
	out		DDRD,temp1		;make PD0,PD1,PD5 outputs

;not sure if we need this code
	ldi		temp1,$FF			;set pullup resistors and
	out		PORTD,temp1 	;

;init misc
	ldi		StepRate,6		;set to the 1,000,000's position
	clr		encoder				;clear encoder interrupt counts
	clr		press					;clear press interrupt counts
 
	ldi		temp1,$05			;set timer0 prescale divisor to 1024
	out		TCCR0B,temp1	;using 20.48 XTAL = 50uS
 
	ldi		temp1,$01
	sts		TIMSK0,temp1	;enable TIMER0 overflow interrupts

	ldi		temp1,$03
	out		EIMSK,temp1		;enable int0 and int1 interrupts

	ldi		temp1,0b00001011	; int1 on falling edge & int0 on rising edge
	sbic	PIND,STATE				; test state of encoder
	ldi		temp1,0b00001010	; int1 on falling edge & int0 on falling edge
	sts		EICRA,temp1

	ldi		temp1,$21 ;reset AD9834 and init all registers
	ldi		temp2,$00
	rcall	SHIFT_16 ;output to DDS chip

	ldi		temp1,$7F ;freq0 ls 14 bits
	ldi		temp2,$29
	rcall	SHIFT_16 ;output to DDS chip 

	ldi		temp1,$47 ;freq0 ms 14 bits
	ldi		temp2,$FF
	rcall	SHIFT_16 ;output to DDS chip 

	ldi		temp1,$80 ;freq1 ls 14 bits
	ldi		temp2,$00
	rcall	SHIFT_16 ;output to DDS chip 

	ldi		temp1,$80 ;freq1 ms 14 bits
	ldi		temp2,$80
	rcall	SHIFT_16 ;output to DDS chip 

	ldi		temp1,$C0 ;clear phase0
	ldi		temp2,$00
	rcall	SHIFT_16 ;output to DDS chip

	ldi		temp1,$E0 ;clear phase1
	ldi		temp2,$00
	rcall	SHIFT_16 ;output to DDS chip

	ldi		temp1,$20 ;enable output
	ldi		temp2,$00
	rcall	SHIFT_16 ;output to DDS chip

	rcall	DEFAULT_FREQ	;move default freq to buffers
	rcall	FREQ_OUT 			;output freq bits to DDS chip
  
	sei									;global all interrupt enable

	ldi		temp1,2				;blink LED 2x to show system is working
	rcall BLINK_LED
	
	rcall	INIT_LCD

	ldi		ZH,high(2*msg1)
	ldi		ZL,low(2*msg1)
	ldi		temp1,$80				;display on line 1
	rcall	LCDCMD
	rcall	DISPLAY_LINE

	;ldi		ZH,$01
	;ldi		ZL,$00
  ;ldi ZH,high(SRAM_START+8)
  ;ldi ZL,low(SRAM_START+8)
	;rcall	SHOWHEX_LINE 
	rcall ShowFreq

menu: ;main program
 tst encoder ;check for encoder pulses
 breq menu5  ;exitif no pulses
 brpl menu1   ;branch if positive
 cbi PORTC,LED ;turn LED on
 inc encoder
 rcall DecFreq0
 cpi temp1,55 ; if 55 then all is OK
 brne menu05
 rcall IncFreq0 ;correct overflow
 rjmp menu2
menu05:
 rcall DecFreq9 ;update the DDS
 rcall FREQ_OUT
 rcall ShowFreq
 rjmp menu2
menu1:
 cbi PORTC,LED ;turn LED on
 dec encoder
 rcall IncFreq0
 cpi temp1,55 ; if 55 then all is OK
 brne menu15
 rcall DecFreq0 ;correct overflow
 rjmp menu2
menu15:
 rcall IncFreq9 ;update the DDS
 rcall FREQ_OUT
 rcall ShowFreq
menu2:
 ;ldi delay,20
 ;rcall wait
 sbi PORTC,LED  ;turn LED off
 ;ldi delay,20
 ;rcall wait
menu5:
 tst press
 breq menu9
 dec press
 ;in temp1,PIND ; look for reverse StepRate
 ;ldi temp2,2
 ;and temp1,temp2
 ;cpi temp1,2
 ;breq menu55
 ;inc StepRate
 ;cpi StepRate,8
 ;brne menu6
 ;ldi StepRate,0
 ;rjmp menu6
menu55:
 dec StepRate
 brpl menu6
 ldi StepRate,7
 rjmp menu6
menu6:
 rcall ShowCursor
 cbi PORTC,LED ;turn  LED on
 ;ldi delay,20
 ;rcall wait
 sbi PORTC,LED  ;turn LED off
 ;rcall wait
menu9:
 rjmp menu
	
DISPLAY_LINE:
	lpm		temp1,Z+
	tst		temp1
	breq	DISPLAY_LINE_FINIS
	rcall	LCDCHR
	rjmp	DISPLAY_LINE
DISPLAY_LINE_FINIS:
 ret
 
;************************************
;* INIT_LCD
;* uses temp1 
;************************************
INIT_LCD:
	ldi		delay,20			;wait 20 milliseconds for system to stabilize
	rcall	WAIT
	ldi		temp1,$30
	rcall LCDCMD
	ldi		delay,4				;wait 4 milliseconds
	rcall	WAIT	
	ldi		temp1,$38			;set for 8 bits, 2 lines, default font
	rcall LCDCMD
	ldi		temp1,$01			;Clear screen, cursor home
	rcall LCDCMD
	ldi		temp1,$0E			;Display on, cursor on, blink off
	rcall LCDCMD
	ret

;************************************
;* WAIT
;* temp1 = WAIT time in milliseconds
;************************************
WAIT:
	tst		delay
	brne	WAIT
	ret

;************************************
;* BLINK_LED
;* temp1 = number of times LED BLINKS
;************************************
BLINK_LED:
	cbi		PORTC,LED				;turn LED on
	ldi		delay,200				;200 mSec
	rcall WAIT
	sbi		PORTC,LED				;turn LED off		
	ldi		delay,200				;200 mSec
	rcall	WAIT
	dec		temp1
	brne	BLINK_LED
	ret
	
;************************************
;* LCDCMD - Send a command to the LCD
;* temp1 = cmd
;*****************************************
;* LCDCHR - Display a character on the LCD
;* temp1 = data
;************************************
LCDCMD: 
	rcall	SENDBYTE
	cbi		PORTC,LCD_DRS			;set RS low
	rjmp	LCDEXEC
LCDCHR:
	rcall	SENDBYTE
	sbi		PORTC,LCD_DRS			;set RS High
LCDEXEC:
	sbi		PORTC,LCD_E				;E clocks on rising edge
	ldi		delay,2				;wait 2 milliseconds
	cbi		PORTC,LCD_E				;set E low
	rcall	WAIT
	ret
	
;**********************************
;* SENDBYTE clock byte into 74hc164
;* temp1 = data
;* temp2 = bitcounter
;***********************************
SENDBYTE:
	push	temp2
	ldi		temp2,8					;bit counter
ShiftBits:
	cbi		PORTC,LCD_DRS   ;set LCD Data bit to 0
	lsl		temp1						;shift bits in AReg into carry
	brcc	ClockBit				;if zero, clock it out
	sbi		PORTC,LCD_DRS   ;if 1, set LCD Data bit to 1
ClockBit: 
	sbi		PORTC,LCD_CP		;bit clocks on rising edge
	cbi		PORTC,LCD_CP		;bring clock back to 0
	dec		temp2						;shift out 8 bits
	brne	ShiftBits
	pop		temp2
	ret      	

IncFreq0:
 mov temp2,StepRate
 ldi ZH,high(rcve0)
 ldi ZL,low(rcve0)
 ldi temp1,9
IncFreq1:
 dec temp1
 dec ZL
 dec temp2
 brpl IncFreq1
IncFreq2:
 ld temp3,Z
 inc temp3
 cpi temp3,10
 clc
 brne IncFreq3
 sec
 clr temp3
IncFreq3:
 st Z,temp3
 brcc IncFreq7
 dec ZL
 dec temp1
 rjmp IncFreq2
IncFreq7:
 ldi ZH,high(LCDrcve0)
 ldi ZL,low(LCDrcve0)
 ld temp1,Z
 cpi temp1,3		;check for 30MHz
 brlo IncFreq8
 ldi temp1,55		;55 is a error status flag
IncFreq8:
 ret

IncFreq9:
 ldi ZH,high(freq0)
 ldi ZL,low(freq0)
 mov temp2,StepRate
 lsl temp2
 lsl temp2
 add ZL,temp2
 ldi YH,high(rcve0)
 ldi YL,low(rcve0)
 ld temp1,Z+
 ld temp2,Y
 add temp1,temp2
 st Y+,temp1
 ld temp1,Z+
 ld temp2,Y
 adc temp1,temp2
 st Y+,temp1
 ld temp1,Z+
 ld temp2,Y
 adc temp1,temp2
 st Y+,temp1
 ld temp1,Z+
 ld temp2,Y
 adc temp1,temp2
 st Y+,temp1
 ret

DecFreq0:
 mov temp2,StepRate
 ldi ZH,high(rcve0)
 ldi ZL,low(rcve0)
 ldi temp1,9
DecFreq1:
 dec temp1
 dec ZL
 dec temp2
 brpl DecFreq1
DecFreq2:
 ld temp3,Z
 dec temp3
 cpi temp3,255
 clc
 brne DecFreq3
 sec
 ldi temp3,9
DecFreq3:
 st Z,temp3
 brcc DecFreq7
 dec ZL
 dec temp1
 rjmp DecFreq2
DecFreq7:
 ldi ZH,high(LCDrcve0)
 ldi ZL,low(LCDrcve0)
 ld temp1,Z
 cpi temp1,3		;check for 30MHz
 brlo DecFreq8
 ldi temp1,55		;55 is a error status flag
DecFreq8:
 ret

DecFreq9:
 ldi ZH,high(freq0)
 ldi ZL,low(freq0)
 mov temp2,StepRate
 lsl temp2
 lsl temp2
 add ZL,temp2
 ldi YH,high(rcve0)
 ldi YL,low(rcve0)
 ld temp2,Z+
 ld temp1,Y
 sub temp1,temp2
 st Y+,temp1
 ld temp2,Z+
 ld temp1,Y
 sbc temp1,temp2
 st Y+,temp1
 ld temp2,Z+
 ld temp1,Y
 sbc temp1,temp2
 st Y+,temp1
 ld temp2,Z+
 ld temp1,Y
 sbc temp1,temp2
 st Y+,temp1
 ret
 
;**********************************
;* ShowFreq
;* uses temp1 & temp2
;***********************************
ShowFreq: ;display freq on LCD
 ldi temp1,$C1
 rcall LCDCMD
 ldi ZH,high(LCDrcve0)
 ldi ZL,low(LCDrcve0)
 clr temp2
 ld temp1,Z+
 add temp2,temp1
 brne ShowFreq1
 ldi temp1,' '
ShowFreq1:
 rcall SHOWDEC
 ld temp1,Z+
 add temp2,temp1
 brne ShowFreq2
 ldi temp1,' '
ShowFreq2:
 rcall SHOWDEC
 ldi temp1,','
 tst temp2
 brne ShowFreq3
 ldi temp1,' '
ShowFreq3:
 rcall SHOWDEC
 ld temp1,Z+
 add temp2,temp1
 brne ShowFreq4
 ldi temp1,' '
ShowFreq4:
 rcall SHOWDEC
 ld temp1,Z+
 add temp2,temp1
 brne ShowFreq5
 ldi temp1,' '
ShowFreq5:
 rcall SHOWDEC
 ld temp1,Z+
 add temp2,temp1
 brne ShowFreq6
 ldi temp1,' '
ShowFreq6:
 rcall SHOWDEC
 ldi temp1,','
 tst temp2
 brne ShowFreq7
 ldi temp1,' '
ShowFreq7:
 rcall SHOWDEC
 ld temp1,Z+
 add temp2,temp1
 brne ShowFreq8
 ldi temp1,' '
ShowFreq8:
 rcall SHOWDEC
 ld temp1,Z+
 add temp2,temp1
 brne ShowFreq9
 ldi temp1,' '
ShowFreq9:
 rcall SHOWDEC
 ld temp1,Z+
 rcall SHOWDEC
 ldi temp1,' '
 rcall LCDCHR
 ldi temp1,'H'
 rcall LCDCHR
 ldi temp1,'z'
 rcall LCDCHR
 rcall ShowCursor
 ret

ShowCursor: ;position cursor to active position
 ldi temp1,$CA
 sub temp1,StepRate
 cpi temp1,$C8
 brsh ShowCursor1
 dec temp1
ShowCursor1:
 cpi temp1,$C4
 brsh ShowCursor2
 dec temp1
ShowCursor2:
 rcall LCDCMD
 ret

EXT_INT0:
	push	temp1 ;save temp1 register
	in		temp1,SREG ;save the status register
	push	temp1
	lds		temp1,EICRA
	cpi		temp1,0b00001010	; test falling edge
	breq	int05
	ldi		temp1,0b00001010	; set int0 for falling edge and int1 on falling edge
	sts		EICRA,temp1
	sbis	PIND,PHASE ; test PHASE
	rjmp	int01
	dec		encoder
	rjmp	int09
int01:
	inc		encoder
	rjmp	int09
int05:
	ldi		temp1,0b00001011	; set int0 for rising edge and int1 on falling edge
	sts		EICRA,temp1
	sbis	PIND,PHASE ; test PHASE
	rjmp	int06
	inc		encoder
	rjmp	int09
int06:
	dec		encoder
int09:
	pop		temp1
	out		SREG,temp1 ;restore the status register
	pop		temp1   ;restore temp1 register
	reti

EXT_INT1:
 push temp1
 in temp1,SREG
 inc press
 out SREG,temp1
 pop  temp1
 reti


;**********************************
;* Timer 0 Overflow
;* gets here every 1 millisecond
;* decrements the DELAY counter
;***********************************     	
OVF0:
	push	temp1
	in		temp1,SREG
	push	temp1
	ldi		temp1,256-20		;1 ms using a 20.48 MHz Xtal
	out		TCNT0,temp1			;set for next overflow
	tst		delay
	breq	OVF_EXIT
	dec		delay
OVF_EXIT:
	pop		temp1
	out		SREG,temp1
	pop		temp1
	reti

;**********************************
;* SHOWHEX
;* display HEX byte from temp1
;* at active LCD position
;***********************************  
SHOWHEX:
;preserves temp1 and temp2 values
	push	temp1
	push	temp2
	push	temp1
	swap	temp1
	andi	temp1,$0F
	ori		temp1,$30
	cpi		temp1,$3A
	brlo	SHOWHEX2
	ldi		temp2,$07
	add		temp1,temp2
SHOWHEX2:
	rcall	LCDCHR
	pop		temp1
	andi	temp1,$0F
	ori		temp1,$30
	cpi		temp1,$3A
	brlo	SHOWHEX3
	ldi		temp2,$07
	add		temp1,temp2
SHOWHEX3:
	rcall	LCDCHR
	pop		temp2
	pop		temp1
	ret

;**********************************
;* SHOWDEC
;* display DEC byte from temp1
;* at active LCD position
;***********************************  
SHOWDEC:
	cpi		temp1,10
	brsh	SHOWDEC1
	ori		temp1,$30
SHOWDEC1:
	rcall	LCDCHR
	ret
	
;**********************************
;* SHOWHEX_CHAR
;* display one HEX byte on line 2
;* byte count in temp2
;*********************************** 
SHOWHEX_CHAR:
	ldi		temp1,$C0		;display on line 2
	rcall	LCDCMD
	rcall	SHOWHEX			;display both hex nibbles 
	ret
	
;**********************************
;* SHOWHEX_LINE
;* display HEX bytes from non-program memory on line 2
;* byte count in temp2
;*********************************** 
SHOWHEX_LINE:
	ldi		temp1,$C0		;display on line 2
	rcall	LCDCMD
	ldi		temp2,8			;display 8 hex bytes
SHOWHEX_LINE_2:
	ld		temp1,Z+		;get display byte
	rcall	SHOWHEX			;display both hex nibbles 
	dec		temp2
	brne	SHOWHEX_LINE_2
	ret

FREQ_OUT:
 ldi temp1,$20 ;28 bits FREQ0 to AD9834
 ldi temp2,$00
 rcall SHIFT_16 ;output to DDS chip
 ldi yl,low(rcve0)
 ld temp4,y+   ;LSB
 ld temp3,y+   ;
 ld temp2,y+   ;
 ld temp1,y+   ;MSB

 lsr temp1			;MSB-high
 ror temp2			;MSB-low
 ror temp3			;LSB-high
 ror temp4			;LSB-low

 lsr temp1			;MSB-high
 ror temp2			;MSB-low
 ror temp3			;LSB-high
 ror temp4			;LSB-low
 
 lsr temp1			;MSB-high
 ror temp2			;MSB-low
 ror temp3			;LSB-high
 ror temp4			;LSB-low

 lsr temp3
 ror temp4
 lsr temp3
 ror temp4
 
 push temp1
 push temp2
 mov temp1,temp3
 mov temp2,temp4
 
 ori temp1,0b01000000
 rcall SHIFT_16		;send 14 bits
 pop temp2
 pop temp1
 
 push temp1
 push temp2
 ori temp1,0b01000000
 rcall SHIFT_16		;send 14 bits
 
 mov temp1,temp3
 mov temp2,temp4 
 ori temp1,0b10000000
 rcall SHIFT_16		;send 14 bits
 
 pop temp2
 pop temp1
 ori temp1,0b10000000
 rcall SHIFT_16		;send 14 bits
 
 ret
 
;**********************************
;* SHIFT_16
;* display HEX bytes
;* at active LCD position
;* byte count in temp2
;*********************************** 
SHIFT_16:
;16 bit serial out msb first in temp1, then lsb in temp2
 push temp3
 cbi PORTD,DDSenable	;FSYNC goes LOW
 ldi temp3,16					;16 bits bit counter
shift8:
 sbi PORTD,DDSdata		;set port bit
 rol temp1						;shift dds address byte
 brcs clockit				;check for 1/0
 cbi PORTD,DDSdata		;clear port bit
clockit:
 nop
 cbi PORTD,DDSclock		;clock dds
 nop
 sbi PORTD,DDSclock
 dec temp3							;decrement bit counter
 breq sox								;exit if done
 cpi temp3,8						;check byte counter
 brne shift8						;output more bits
 mov temp1,temp2				;get lsb
 rjmp shift8						;write data bits
sox:
 sbi PORTD,DDSenable 		;FSYNC goes HIGH
 pop temp3
 ret

DEFAULT_FREQ: ;FlashToRam
	ldi		ZH,high(FreqHex*2) 	;load default freq
	ldi		ZL,low(FreqHex*2)
	ldi		YH,high(rcve0)
	ldi		YL,low(rcve0)
	ldi		temp2,36
DF1:
	lpm		temp1,Z+
	st		Y+,temp1	;store in SRAM and increment Y-pointer
	dec		temp2			;decrememnt counter
	brne	DF1				;if not end of table, loop more
	
	ldi		ZH,high(FreqLCD*2)	;load default freq
	ldi		ZL,low(FreqLCD*2)
	ldi		YH,high(LCDrcve0)
	ldi		YL,low(LCDrcve0)
	ldi		temp2,8
DF2:
	lpm		temp1,Z+
	st		Y+,temp1	;store in SRAM and increment Y-pointer
	dec		temp2			;decrememnt counter
	brne	DF2				;if not end of table, loop more
	ret       

;UNCALIBRATED freq reference table
FreqHex:
.db 0x33,0x33,0x33,0x33 ;10,000,000 MHz
.db 0x56,0x00,0x00,0x00 ;1
.db 0x5B,0x03,0x00,0x00 ;10
.db 0x8E,0x21,0x00,0x00 ;100
.db 0x8B,0x4F,0x01,0x00 ;1,000
.db 0x71,0x1B,0x0D,0x00 ;10,000
.db 0x6F,0x12,0x83,0x00 ;100,000
.db 0x52,0xB8,0x1E,0x05 ;1,000,000
.db 0x33,0x33,0x33,0x33 ;10,000,000

;CALIBRATED freq reference table
;FreqHex:
;.db 0x33,0x33,0x33,0x33 ;10,000,000 MHz
;.db 0x56,0x00,0x00,0x00 ;1
;.db 0x5B,0x03,0x00,0x00 ;10
;.db 0x8E,0x21,0x00,0x00 ;100
;.db 0x8B,0x4F,0x01,0x00 ;1,000
;.db 0x71,0x1B,0x0D,0x00 ;10,000
;.db 0x6F,0x12,0x83,0x00 ;100,000
;.db 0x52,0xB8,0x1E,0x05 ;1,000,000
;.db 0x33,0x33,0x33,0x33 ;10,000,000

FreqLCD: .db 1,0,0,0,0,0,0,0 ;LCD for 10,000,000 Hz
;FreqLCD: .db 1,4,9,1,3,7,0,0 ;LCD for 10,000,000 Hz + 4,913,700 offset
msg1:
;    1234567890123456789012345678901234567890
.db "DDS DEV KIT V2.0",0,0
;.db "DDS KIT de DB5AG",0,0
