This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin, PWM | |
import time | |
import random | |
import uasyncio | |
t0 = 0 | |
ref0 = 0 | |
pinpwmin = Pin(5,Pin.IN) | |
pindir = Pin(6,Pin.IN) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# iCEstick constraint file | |
# | |
# red LEDs | |
set_io lpc_clk_led 99 | |
# set_io rled1 99 | |
set_io lpc_frame_led 98 | |
# set_io rled2 98 | |
set_io lpc_reset_led 97 | |
# set_io rled3 97 | |
set_io valid_lpc_output_led 96 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import ftd2xx as ftd | |
print(ftd.listDevices()) | |
d = ftd.open(1) | |
print(d.getDeviceInfo()) | |
d.resetDevice() | |
d.setBitMode(0xff, 0x40) | |
d.setUSBParameters(64*1024, 64*1024) | |
d.setFlowControl(ftd.defines.FLOW_RTS_CTS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* IceZProg -- Programmer and Debug Tool for the IcoZero Board | |
* | |
* Copyright (C) 2017 Clifford Wolf <[email protected]> | |
* | |
* Permission to use, copy, modify, and/or distribute this software for any | |
* purpose with or without fee is hereby granted, provided that the above | |
* copyright notice and this permission notice appear in all copies. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wave | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import array | |
wav_obj = wave.open('spike11K.wav', 'rb') | |
sample_freq = wav_obj.getframerate() | |
print(sample_freq) | |
n_samples = wav_obj.getnframes() | |
print(n_samples) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SB_PLL40_PAD #( | |
.FEEDBACK_PATH("SIMPLE"), | |
.PLLOUT_SELECT("GENCLK"), | |
.DIVR(4'b0000), | |
.DIVF(7'b1010100), | |
.DIVQ(3'b101), | |
.FILTER_RANGE(3'b001), | |
) SB_PLL40_CORE_inst ( | |
.RESETB(1'b1), | |
.BYPASS(1'b0), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rom ( | |
input clk, | |
input [6:0] addr, | |
output reg [7:0] data); | |
reg [7:0] Rom [127:0]; | |
initial $readmemh("Rom.data", Rom); | |
always @(posedge clk) | |
data <= Rom[addr]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin, I2C | |
import binascii | |
def i2c_read(i2c,reg): | |
rx_buf = bytearray(1) | |
reg_add = bytearray(1) | |
reg_add[0] = reg | |
i2c.writeto(0x55, reg_add) | |
rx_buf = i2c.readfrom(0x55, 1) | |
return binascii.hexlify(rx_buf) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SB_IO #( | |
.PIN_TYPE(6'b1010_01), | |
.PULLUP(1'b0) | |
) triState ( | |
.PACKAGE_PIN(pin), | |
.OUTPUT_ENABLE(oe), | |
.D_OUT_0(dout), | |
.D_IN_0(din) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////////////////////////////////////////////////////// | |
// | |
// File: random_pulse_generator.v | |
// File history: | |
// Version 1: 2015-03-24: Created | |
// | |
// Description: | |
// | |
// Poisson process generator. | |
// Generate Poisson process with desired inversed rate (number of clocks per hit). |