Skip to content

Commit

Permalink
JJY波形
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue-Crescent committed Feb 7, 2024
1 parent c911e7f commit c96b008
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 15 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RTCなどを使用して時刻を維持し、マイコン側で時を刻まな
![](img/IMG_5777.jpeg)
![](img/IMG_5776.jpeg)

負論理出力でした。JJY信号の波形の立下りが1秒幅になります。


| 基板シルク | 機能 |
| ----- | --------------------------------------------------------------------------------------------------------------- |
Expand All @@ -54,6 +54,36 @@ RTCなどを使用して時刻を維持し、マイコン側で時を刻まな
| GND | 基準電位 |
| VDD | 1.1~3.3 v |



負論理出力でした。JJY信号の波形の立下りが1秒幅になります。

![](D:\Documents\Arduino\libraries\JJYreceiver\img\wave%20(2).jpeg)

JJY波形



![](D:\Documents\Arduino\libraries\JJYreceiver\img\wave%20(3).jpeg)

H



![wave (5).jpeg](D:\Documents\Arduino\libraries\JJYreceiver\img\wave%20(5).jpeg)

L



![wave (6).jpeg](D:\Documents\Arduino\libraries\JJYreceiver\img\wave%20(6).jpeg)

P,M





補足
lgt8f328pを使用する場合は、書き込み時にVccは5Vが出力されます。この受信モジュールは3.6Vが絶対最大定格ですので、書き込み時は受信モジュールを外すか、電圧レギュレーターをライタとの間に設けて保護してください。3.3Vでも書き込めました。

Expand Down
Binary file added img/wave (1).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/wave (2).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/wave (3).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/wave (4).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/wave (5).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/wave (6).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=JJYReceiver
version=0.1.2
version=0.1.3
author=BlueCrescent
maintainer=BlueCrescent <[email protected]>
sentence=Japan standard time, JJY Receiver library.
paragraph=Japan standard time, JJY protocol decode library. Negative logic type JJY receiver supported.
sentence=JJY standard radio signal wave receiver library.
paragraph=This library returns UTC date time of time_t type. Negative logic type JJY receiver supported. Tested with JJY receiver IC MAS6181B with lgt8f328p.
category=Communication
url=https://github.com/Blue-Crescent/JJYReceiver.git
architectures=*
14 changes: 5 additions & 9 deletions src/JJYReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ time_t JJYReceiver::getTime() {
globaltime = localtime[0];
return globaltime;
}
if(state == TIMEVALID)
power(false);
return;
//DEBUG_PRINT(diff1);
//DEBUG_PRINT(" ");
//DEBUG_PRINT(diff2);
Expand Down Expand Up @@ -183,9 +186,6 @@ JJYReceiver::jjy_receive(){
if(monitorpin != -1) digitalWrite(monitorpin,HIGH);

}
// if(rcvcnt == VERIFYLOOP){
// power(false);
// }
}
JJYReceiver::status(){
return state;
Expand All @@ -210,11 +210,11 @@ JJYReceiver::power(){
}
JJYReceiver::power(bool power){
if(power == true){
digitalWrite(ponpin,LOW);
if(ponpin != -1) digitalWrite(ponpin,LOW);
delay(300);
return true;
}else{
digitalWrite(ponpin,HIGH);
if(ponpin != -1) digitalWrite(ponpin,HIGH);
return false;
}
}
Expand Down Expand Up @@ -249,10 +249,6 @@ JJYReceiver::stop(){

}

JJYReceiver::receive(){
power(true);
state = RECEIVE;
}
int JJYReceiver::calculateDate(uint16_t year, uint8_t dayOfYear, uint8_t *month, uint8_t *day) {
uint8_t daysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) {
Expand Down
4 changes: 2 additions & 2 deletions src/JJYReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <Arduino.h>
#include <stdint.h>

//#define DEBUG_BUILD
#define DEBUG_BUILD

#ifdef DEBUG_BUILD
#include <SoftwareSerial.h>
Expand Down Expand Up @@ -105,7 +105,6 @@ class JJYReceiver {
int monitor(int monitor);
int rotateArray(int8_t shift, uint16_t* array, uint8_t size);
int calculateDate(uint16_t year, uint8_t dayOfYear, uint8_t *month, uint8_t *day);
int receive();
int distance(uint8_t* arr1, uint8_t* arr2, int size);
int max_of_three(uint8_t a, uint8_t b, uint8_t c);
bool calculateParity(uint8_t value, uint8_t bitLength, uint8_t expectedParity);
Expand Down Expand Up @@ -141,6 +140,7 @@ class JJYReceiver {
for(uint8_t index = 0; index < VERIFYLOOP; index++){
localtime[index] = index * -100;
}
power(true);
}

};
Expand Down

0 comments on commit c96b008

Please sign in to comment.