Skip to content

Instantly share code, notes, and snippets.

View la3pna's full-sized avatar

Thomas S. Knutsen la3pna

  • HBV / HIVE
  • Drammen, NORWAY
View GitHub Profile
@willasaywhat
willasaywhat / gist:1586278
Created January 10, 2012 01:43
Arduino 22 - TC74 Code
#include <Wire.h>
#define i2c_addr 0x4F
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
@pklaus
pklaus / arduino-due_high-speed-ADC.ino
Last active October 4, 2023 02:20
Arduino Due: ADC → DMA → USB @ 1MSPS
#undef HID_ENABLED
// Arduino Due ADC->DMA->USB 1MSPS
// by stimmer
// from http://forum.arduino.cc/index.php?topic=137635.msg1136315#msg1136315
// Input: Analog in A0
// Output: Raw stream of uint16_t in range 0-4095 on Native USB Serial/ACM
// on linux, to stop the OS cooking your data:
// stty -F /dev/ttyACM0 raw -iexten -echo -echoe -echok -echoctl -echoke -onlcr
@NT7S
NT7S / hamqth.py
Last active January 3, 2016 14:59
Class to query HamQTH
import urllib
import urllib2
import xml.etree.ElementTree as ET
import datetime
class hamqth:
username = None
password = None
session_id = None
session_id_timestamp = datetime.datetime.now()
@NT7S
NT7S / Si5351A_PSK.ino
Last active April 23, 2023 19:53
Generate PSK31 with an Si5351A
#include <si5351.h>
#include "Wire.h"
Si5351 si5351;
uint16_t varicode[] =
{
0b1010101011000000, // 0 NUL
0b1011011011000000, // 1 SOH
0b1011101101000000, // 2 STX
@NT7S
NT7S / homebrew-arduino-zero-setup.md
Created June 29, 2015 18:45
Homebrew Arduino Zero Tool Setup

Homebrew Arduino Zero Tool Setup

A guide for installing the tools necessary to build up a homebrew barebones Arduino Zero (based on the Atmel SAMD21G18A microcontroller) on a Linux PC. While this guide is written for a Debian-based distribution such as Linux Mint, it should be adaptable to other distributions fairly easily.

This guide also assumes that we will be using the ATMEL-ICE debugger to write the Arduino bootloader to the SAMD21G18A flash memory via the Cortex Debug Connector.

Install Arduino IDE

You'll need a recent version of the Arduino IDE which has support for the Arduino Zero in the Boards Manager. As of this writing, the latest stable version is 1.6.5, so be sure to use at least this version. Also as of this writing, the version of the Arduino IDE in the Linux Mint repositories is quite old, so don't use that one.

[00:06] <LA3PNA2> NT7S, when you find a break, would you mind sketchin out how you determined the PLL parameters for the Si? I kinda would like to use that if I do a beacon
[00:09] <NT7S> my algorithm?
[00:12] <LA3PNA2> more like, if we could figure out a program that determines the PLL freq and such when you input your wanted frequency
[00:13] <NT7S> ah
[00:14] <LA3PNA2> basicaly I'd like to be able to use that in the beacon
[00:14] <LA3PNA2> but, you should get on the JT9 first
[00:14] <NT7S> the general strategy is find a PLL frequency that is the highest integer divisor for the output frequency
[00:15] <NT7S> then tweak the PLL frequency the PPB to correct for the ref osc error
[00:15] <NT7S> so the divider for the PLL synth will not be an integer divider, but in many cases the multisynth will be
[00:16] <LA3PNA2> ah, so you aim for the multisynt to be a integer
@NT7S
NT7S / wspr_encode.c
Created September 25, 2015 02:29
My unoptimized implementation of the WSPR encoding process
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
uint8_t wspr_code(char c)
{
/* Validate the input then return the proper integer code */
// Return 255 as an error code if the char is not allowed
@NT7S
NT7S / compile.txt
Last active September 29, 2015 17:52
JT65 Encoder in C
gcc jt65_encode.c encode_rs_int.c init_rs_int.c -o jt65_encode
@NT7S
NT7S / jt9_encode.c
Created September 28, 2015 00:57
JT9 Encoder in C
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
uint8_t jt_code(char c)
{
/* Validate the input then return the proper integer code */
// Return 255 as an error code if the char is not allowed
@NT7S
NT7S / Si5351_JT9.ino
Last active July 14, 2019 12:49
Simple JT9 beacon for Arduino driving the Si5351
//
// Simple JT9 beacon for Arduino, with the Etherkit Si5351A Breakout
// Board, by Jason Milldrum NT7S.
//
// Transmit an abritrary message of up to 13 valid characters
// (a Type 6 message).
//
// Original code based on Feld Hell beacon for Arduino by Mark
// Vandewettering K6HX, adapted for the Si5351A by Robert
// Liesenfeld AK6L <ak6l@ak6l.org>. Timer setup