Skip to content

Commit 2c19807

Browse files
committed
add another example, xtal driving
1 parent 8512aaf commit 2c19807

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

examples/program_uno328.py

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
avrprog = adafruit_avrprog.AVRprog()
1818
avrprog.init(spi, board.D5)
1919

20+
# we can generate an 6 MHz clock for driving bare chips too!
21+
clock_pwm = pulseio.PWMOut(board.D9, frequency=6000000, duty_cycle=65536//2)
22+
2023
# Each chip has to have a definition so the script knows how to find it
2124
atmega328p = {'name': "ATmega328P"}
2225
atmega328p['sig'] = [0x1E, 0x95, 0x0F]

examples/read_signature.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
Read Signature Test - All this does is read the signature from the chip to
3+
check connectivity!
4+
"""
5+
6+
import board
7+
import busio
8+
import pulseio
9+
import adafruit_avrprog
10+
11+
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
12+
avrprog = adafruit_avrprog.AVRprog()
13+
avrprog.init(spi, board.D5)
14+
15+
# we can generate an 6 MHz clock for driving bare chips too!
16+
clock_pwm = pulseio.PWMOut(board.D9, frequency=6000000, duty_cycle=65536//2)
17+
18+
avrprog.begin()
19+
print("Signature bytes: ", [hex(i) for i in avrprog.read_signature()])
20+
avrprog.end()

0 commit comments

Comments
 (0)