Skip to content

Instantly share code, notes, and snippets.

View raivisr's full-sized avatar

Raivis Rengelis raivisr

View GitHub Profile
@raivisr
raivisr / main.c
Created February 21, 2013 19:48
stdio over UART1 example for xc32
// set heap size in project properties under xc32-ld to something like 256
// or it will not link
#include <xc.h>
#include <plib.h>
#include <stdio.h>
#pragma config FNOSC = PRIPLL, FPLLIDIV = DIV_2, FPLLMUL = MUL_20, FPLLODIV = DIV_1
#pragma config POSCMOD = XT, FWDTEN = OFF, FPBDIV = DIV_1, FSRSSEL = PRIORITY_3
@raivisr
raivisr / ad9850.pde
Created October 9, 2012 21:12
AD9850 useful test sketch for Arduino(-s)
/*
Simple controller for AD9850 modules
Uses serial protocol (refer to AD9850 datasheet what pins need to be pulled up/down
Uses library by Elecfreaks http://elecfreaks.com/store/download/datasheet/breakout/DDS/EF_AD9850_library.zip
(for use with chipkit delete that unnecessary line "#include <avr/pgmspace.h>" from .h file)
Fix the pin numbers used to communicate with module
Serial comms - 9600, NewLine (0x0A) denotes end of input,
f 10000 - set frequency
s 20 20000 10 1000 - sweep from frequency to frequency using this step size in that many milliseconds
o 10 10000 5 3000 - oscillating sweep from frequency to frequency and back using this step size in that many ms