USBASP ATtiny85보드용 커넥터 제작

ATtiny85 보드를 프로그래밍을 할때마다 매번 선 체크해서 연결하는게 번거로와 PCB를 만들었습니다.

아래 사진은 이전에 작업하던 방식입니다.

가운데 있는 모듈이 이번에 만든 PCB보드입니다.

USBASP와 ATtiny85보드를 연결하기 쉽게 만들어 줍니다.

간단한 보드지만 프로그램 업로드 할때 바로 꽂아서 연결하니깐 훨씬 편하네요.

LGT8F328P 아두이노 나노 호환 보드

나노와 99%이상 호환이 가능하다는 LGT8F328P보드입니다. 가격은 1/2 – 2/3 수준인데 호환이 잘만 된다면 앞으로 이걸로 구입해서 작업해도 문제가 없겠네요.

가운데 메인칩에 마킹이 없습니다. ATmega328 카피 버전이 아닐까 생각이 됩니다.

아래의 홀텍 USB 칩입니다. 나노 클론에서 많이 쓰는 CH340G칩이 아니네요. 홀텍칩은 따로 USB 드라이버 안 잡아도 윈도우에서 자동으로 잡히네요.

아두이노 IDE에서 셋팅은 다음과 같습니다. Preferences에 아래의 링크를 추가해 주시면 됩니다.

https://raw.githubusercontent.com/dbuezas/lgt8fx/master/package_lgt8fx_index.json

다음에는 실제 프로젝트에서 구동해 보고 결과물을 올려야겠네요. 굳이 돈 더주고 나노를 살 필요는 없을거 같습니다.

MC14490 하드웨어 디바운스

하드웨어 디바운스되는 칩중에서 이 칩이 최고중의 하나가 아닐까 합니다. 

Features
• Diode Protection on All Inputs
• Six Debouncers Per Package
• Internal Pullups on All Data Inputs
• Can Be Used as a Digital Integrator, System Synchronizer, or Delay Line
• Internal Oscillator (R−C), or External Clock Source
• TTL Compatible Data Inputs/Outputs
• Single Line Input, Debounces Both “Make” and “Break” Contacts
• Does Not Require “Form C” (Single Pole Double Throw) Input Signal
• Cascadable for Longer Time Delays
• Schmitt Trigger on Clock Input (Pin 7)
• Supply Voltage Range = 3.0 V to 18 V

10nf를 사용했습니다. 100ms정도 타이밍으로 버튼 클릭 가능합니다.

테스트용 아두이노 코드입니다. 하드웨어적으로 처리하기 때문에 delay없이 작동합니다. 

int buttonPin = 3;         // the number of the input pin
int ledPin = 13;       // the number of the output pin

int state = 0;      // the current state of the output pin
int reading;           // the current reading from the input pin
int previous = 0;    // the previous reading from the input pin


void setup()
{
  pinMode(buttonPin,  INPUT_PULLUP);
  pinMode(ledPin, OUTPUT);

  Serial.begin(9600);
}

void loop()
{
  reading = digitalRead(buttonPin);

  if (reading == 0 && previous == 1)
  {
    state = !state;

    Serial.println("button pressed");
  }

  digitalWrite(ledPin, state);

  previous = reading;
}

PLL LCD 라디오 수신기

LCD 라디오 수신기 모듈로 라디오를 만들어 봅니다. RX, TX도 있어서 아두이노를 연결하여 명령어로 조정도 가능합니다. 다음번에는 그렇게 한번 만들어 봐야 할거 같네요.

제품 사양은 아래와 같습니다.

FM radio module / LCD version

Product parameters:
Output power: 500mW (drive headphones)
Frequency response range: 50Hz-18KHz
Channel: Stereo
Receiving frequency adjustment range:
Turn off campus broadcast 87.0MHz-108.0MHz,
Turn on campus broadcast 76.0MHz-108.0MHz Equivalent noise: ≥30dB
Supply voltage: 3.0V-5.0V
Current: 40mA

  • PLL digital frequency lock, no frequency
  • 30 level digital volume control
  • 76.0-108.0MHZ full coverage
  • Wide voltage 3-5V power supply
  • Automatic search storage function
  • Power off memory volume / frequency
  • Mono / Stereo Control
  • Support serial command control

Pinout

1 (L): left channel audio output
2(G): audio ground
3 (R): right channel audio output
4 (V+) : Short press volume + / long press continuous +
5 (V-): Short press volume – / long press continuous –
6(F+) : Short press a station / long press down to search for a station
7(F-) : Short press the previous station / long press to search for the station
8(P): Short press mute/long press full band search and save station
9 (DM): USB DM cable
10 (DP) : USB DP data cable
11 (TX): TTL serial port sender
12 (RX): TTL serial port receiver
13 (+5V): 5V power input (3-5V wide range)
14(G): power ground
15 (ANT): External FM radio antenna end

버튼 연결은 4번부터 8번까지 총 5개입니다. 버튼 반대쪽은 GND에 연결합니다.
이어폰잭에 연결해서 테스트 해봤습니다.

또 다른 Arduino Nano 보드들

오른쪽의 보드는 아두이노 나노보드인데 usb 칩이 CH340E 으로 구성되어 있습니다. 보통 많이 들어간 CH340G가 아닙니다. 이 칩은 크리스탈이 칩안에 구성되어 있다고 하네요.

왼쪽 보드는 아두이노 나노인데 메인칩이 ATmega328이 아닌 ATmega168 로 구성되어 있습니다. 2009년에 나온 Arduino Duemilanove에 들어간 칩이라서 메모리 구성이 반이네요.

AVRISP MKII

https://www.microchip.com/webdoc/avrispmkii/index.html

이 제품이 있으면 ATmel studio 7.0을 사용하여 프로그램밍이 가능합니다. 정품은 아니고 중국에서 만든 제품인데 프로그램에서는 avrisp mk2로 제대로 나옵니다. 가격은 1.5만원입니다. 메인칩은 Atmega128A가 들어가 있고 PDIUSBD12, 74HC4053D, 74HC4066D, AMS1117-3.3v로 구성되어 있네요.

ATtiny85 보드 업로드 하기

v-usb 방식으로 업로드 가능하지만 안정성이 떨어져서 좋지 않네요. usbasp 사용하는게 빠르고 확실합니다.

usbasp의 vcc는 attiny85보드의 5V, gnd-gnd로 연결합니다. 나머지 mosi, miso, slk, reset 연결해주면 됩니다.

보드 셋팅은 아래와 같습니다. Digispark로 디폴트 선택하면 되고 Programmer는 usbasp로 선택합니다.

스케치 메뉴에 있는 Upload Using Programmer를 클릭하면 프로그램 업로드가 완료됩니다.

FM 라디오 송신기

주파수 조정이 디지털로 가능한 송신기입니다. 마이크도 붙어 있습니다.

PLL 76.0-108.0MHZ FM Stereo Transmitter Module

1. Product Introduction:

1. Output Power:100mW

2. Audio Frequency Response Range:50Hz-18KHz

3. Transmission Frequency:87.0MHz-108.0MHz (campus broadcast power off);76.0MHz-108.0MHz (campus broadcast power on)

4. Frequency Adjustment Stepping:0.1MHz/times (short press the key);1.0MHz/times (long press the key)

5. Modulation Mode:standard FM

6. Sound Track:LINE/USB channel (stereo);MIC channel (single channel)

7. Equivalent Noise:>=30dB

8. Power Supply Voltage:DC 3.0V-5.0V

9. Operating Current:35mA

10. Adaptive Antenna:75cm bar antenna

2. Application:

1. FM Wireless Frequency

2. USB PC Audio Broadcast

3. Wireless Microphone

4. Maternal And Infants Custody

3. Instruction:

1. Power supply

The corresponding port of the module “-“, “+” respectively connects the power (battery) negative pole and the positive pole. The power supply is recommended for battery or other stabilized power supply.Do not use an unfiltered power supply (such as a mobile phone charger and other low-quality switching power supply), otherwise the interference of the power supply will affect the normal work of the module.The normal working voltage of this module is 3.0-5.0V, and the power supply voltage should not exceed this range.

2. Buttons

Volume +/- : short press volume +/- 1, long press continuous +/-.

Frequency +/- : short press frequency +/ -0.1mhz, long according to continuous +/ -1mhz.

Mute: short press to switch mute/non-mute.

3. Antenna

The ANT port is used to connect the FM antenna. In order to better transmit the FM signal, it is recommended to extend the antenna with a length of 75cm. And the antenna is near as far as possible without obstruction.

4. USB audio connection

If you want to start the USB audio broadcast function of this module, you need to connect the USB cable to the computer. USB port is compatible with common cell phone, so you can use the USB cable to connect the module and computer. Because computer USB comes with 5V output, USB connection can be used to supply power to the module directly. After connecting to the computer USB, the module will automatically enter the PC audio broadcast mode, the LCD screen will display the PC, the computer terminal will install the driver automatically, and the module will be named “CD002” sound card device. Enable this “CD002” audio device in the computer voice Settings. Computer system audio can be transmitted through this module by FM. When the radio frequency is adjusted to the frequency of this module, the audio of the computer terminal system will be heard.

5. LINE audio connection

If you need this module LINE (line in) channel as a source of sound emission, please insert one end of the audio LINE into 3.5 mm audio jack of the module , insert the other end into your audio device (such as mobile phone headset hole), the module automatically switch to the launch of the audio source LINE channel as FM. The nearby FM radio can be heard from the mobile phone as long as it is tuned to the same frequency as the module.

6. FM wireless microphone

If you need MIC of this module to launch, pull out LINE and USB cable (LINE and USB are not connected). The module is automatically transferred to the MIC channel as the transmitting audio source of FM. This module is equipped with a high sensitivity electret microphone, which can be used in wireless microphone, mother-baby monitoring and so on. Note to adjust the volume of this module to achieve the optimum sound pickup effect when used.

7. Serial port control (please ignore this part without serial port control)

The module reserved TTL level serial port control interface.When TTL serial port communicates with this module, it needs to connect the module’s UART_RX, UART_TX and GND.You can use the external MCU or the computer serial port to send instructions control module related functions.

Note: The computer serial port is not TTL level. When connecting to the computer communication, it is necessary to connect the RS323 level to the TTL power leveling device or to use the USB TTL level serial port module to communicate with the module. Serial command control module requires certain computer expertise, if you don’t understand, please don’t try.

4. User-defined Settings:

1. Setting of backlight LED mode

When the power is off, press the “FRE-” and “FRE+” button at the same time to start up. B1 indicates always bright. B0 indicates that the backlight is closed for 20 seconds, and the reset setting takes effect. (the factory defaults to 20 seconds of backlight delay).

2. Start/close the campus radio frequency band

When the power is off, press VOL+,VOL- key, and power on.LCD display C1, which means to start the campus broadcast.C0 means closing the campus radio frequency band.Set to take effect after restart. (the factory defaults to closing the campus radio frequency band).

3. Settings of stereo/mono transmission mode

The back of the module has two solder joints M,G. Short connecting is the monophonic launch. Disconnecting these two points is the stereo system launch. (the

factory defaults to stereo system launch).

Note: the stereo system must satisfy the input to the module’s audio source is stereo and the radio is also stereo to achieve the stereo effect. When using a single speaker (monophonic) radio or input to the module’s audio signal as mono, there is no stereo.

5. Using attention:

1. The power supply voltage is strictly prohibited to exceed the power supply voltage range of this module.

2. Do not touch the back part of the module when working, so as not to affect the normal work of this module or cause the short-circuit burn module.

6. User Settings (please refer to the above) :

This module can set the backlight state and whether to listen to the campus radio frequency band according to the user’s specific usage.

FM 라디오 수신기

전원과 안테나만 연결하면 다른 모듈 필요없이 이어폰으로 FM 라디오 들을 수 있습니다.

1. Introduction

This FM stereo digital radio circuit board module has built-in DSP digital noise processing. When there is no signal, it will automatically mute and get rid of the noise of the traditional FM radio.

2. Parameter

NO. Parameter Value 1 Output power 500mW (drive earphone), 3Wx2 (drive horn) 2 Frequency range 50Hz-18KHz  3 Receiving frequency range 87.0MHz-108.0MHz 4 Equivalent noise Greater than 30dB 5 Power supply voltage 3.0V-5.0V 6 Power supply current 1000mA at maximum volume,
60mA at minimum volume (for reference only) 7 Sound track Stereo
   

3. Using attention:

1>. The power supply voltage is strictly prohibited to exceed the power supply voltage range of this module.

2>. Do not touch the back part of the module when working, so as not to affect the normal work of this module or cause the short-circuit burn module.

4. Feature

1. Advanced digital audio signal processing technology (DSP) and FM phase-locked loop modulation (PLL) make the sound quality more realistic, more stable performance, and long working frequency without deviation.

2. LCD display is more intuitive and accurate, with extremely low power consumption and minimal noise interference.

3. 30 digital volume adjustment, with buttons, easy to operate.

4. Automatically storage data before power off.

5. Automatic switch of speaker/headphone output.

6. Quartz crystal steady frequency, temperature change reception frequency, no longer drift.

7. It uses professional audio DSP to analyze and process the audio signal, and automatically mute when there is no signal or weak signal.

8. It uses incremental digital rotary encoder to adjust the volume and frequency, using the feel is good, positioning accuracy, stable and durable, 360 ° rotating without blind Angle.

9 Support serial communication control, available computer or MCU and other devices with serial ports to control all functions of the module.

5. Instruction

1. Power supply

Module corresponding port (marked on PCB board).

“-” and “+” are the anode and cathode of the power (battery). The power supply is recommended for battery or other stabilized power supply.You cannot use a power supply without filter (such as mobile phone charger, mobile power supply, and other switching power supply), otherwise the interference caused by power supply will affect the normal work of this module. The normal working voltage of this module is 3.0-5.0V, not exceeding this range. At the maximum volume of the module, the maximum power supply current is around 1A, which requires the battery to output enough current.

2. Antenna

The FM_ANT port is used to connect the FM antenna. To better receive the FM signal, it is recommended to extend the antenna with a length of 75cm.

3. Headset/speaker output

This module is with 3WX2 channel audio amplifier. If the horn is needed, access the speaker port. It is recommended to use 4 Ω / 3 w speakers.If the headset is inserted, the audio will automatically switch to the headphone channel, and the speaker channel will be closed automatically.

4. Volume

Turn the VOL encoder to adjust the volume, while the LCD screen displays the volume series.

5. Frequency regulation

Turn the FRE encoder to adjust the reception frequency, while the LCD screen displays the current frequency, and press the encoder handle to the mute/non-mute switch.

6. Mute

Press the VOL knob to switch the mute/non-mute button down.

7. AMCAP switch

Long press the FRE knob to switch on or off the AMCAP, the LCD display subtitle ON means to turn on the AMCAP, and OFF means to turn off the AMCAP.

8. AMCAP threshold adjustment( when the AMCAP switch on)

Short press the FRE knob to AMCAP threshold adjustment interface, you can adjust the movement threshold of the AMCAP according to the specific usage situation. The adjustment range is 0-20. The higher the value is, the higher the threshold is, the easier the weak signal is to be silent. Vice versa.

9. Serial port (without serial port control)

The module reserved TTL level serial port control interface. TTL serial port and this module communication need to connect the module’s UART_RX, UART_TX and GND (the corresponding position of PCB is marked). You can use the external MCU or the computer serial port to send the command control module related functions. Note: because the computer serial port is not TTL level, connect the computer communication, it is necessary to connect the RS323 level to TTL power leveling device or the USB TTL level serial port module to communicate with this module. This operation requires professionals.

10. User Settings

This module can set the backlight state according to the user’s specific usage. When the power is off, press the FRE button to turn on, and the B0 indicates that the backlight is always bright. B0 indicates that the backlight is closed for 20 seconds, and the setting is effective after the restart. Change the Settings state to repeat this step to switch. The backlight has no operation for 20 seconds.

11. Stereo /mono switch terminal.

Stereo/mono terminals are used to set the FM receiving mode of the module. This terminal is suspended for Stereo reception mode, and it is a single channel receiving mode.

6. FM with squelch receiver module AT instruction:

Baud rate: 38400 TTL level

NONameExampleInstructionRangeReturn position
1Set current frequency pointAT+FRE=875current frequency point is 87.5MHz870-1080 MHzCurrent frequency point/ERR
2Frequency point-0.1MHZAT+FRED  Current frequency point
3Frequency point+0.1MHZAT+FREU  Current frequency point
4Pause paly/Contiune playAT+PAUS  PLAY/PAUS/ERR
5Set volumeAT+VOL=15Current volume is 1500-30VOL value/ERR
6VOL-AT+VOLDVOL-1 VOL value/ERR
7VOL+AT+VOLUVOL+1 VOL value/ERR
8Set backlight time(S). 00 means light off; 01 means normally onAT+BANK=10Backlight is 10s light off00-99BANK value/ERR
9Turn on and off DSP squelchAT+SN=1Turn on squelch0(off) -1(on)SN_OFF/ SN_ON
10Set squelch thresholdAT+SN_THR=10Set squelch threshold is 1000-20SN_THR value/ERR
(Set it when SN _ON)
11Factory data resetAT+CRFactory data reset:
1:VOL=30 //
2:SN_OFF // Turn off DSP squelch 3:SNTHR =10 // reset squelch threshold is 10
4:FRE=875 // Frequency is 87.5MHZ BANK=20// Backlight delay 20s
 OK
12Returns the current state of the moduleAT+RET  VOL=10 // volume 10.
FRE=875 // the frequency is 87.5MHZ.
PLAY/PAUS// static state.
BANK_OFF
(BANK_ON) // backlight time (1 normally open, 0 constant, or delay X s)