├── .gitignore ├── LICENSE ├── README.md └── arduino-hcs-programmer.ino /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | .vscode 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022, IOElectro 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arduino HCS Programmer 2 | Programmer for HCS301 EEPROM Code Hopping using Arduino 3 | 4 | ## Software 5 | [HCS Programmer Soft](https://github.com/ioelectro/hcs-programmer-soft) is An open source application for programming HCS301 EEPROM Code Hopping. 6 | 7 | ## Pinout 8 | ![PinOut](https://user-images.githubusercontent.com/64005694/209934059-14c1d531-2ea9-40ed-a1d3-3ee8cf3b953f.jpg) 9 | ![Arduino-HCS-Programmer](https://user-images.githubusercontent.com/64005694/209924649-6338eec9-1d2b-4353-b1f6-08a926858997.jpg) 10 | 11 | -------------------------------------------------------------------------------- /arduino-hcs-programmer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | HCS Programmer 3 | By Liyanboy74 4 | https://github.com/liyanboy74 5 | */ 6 | 7 | #include 8 | 9 | #define DEBUG 1 10 | 11 | #define LED_PIN LED_BUILTIN 12 | 13 | #define VDD_PIN 2 14 | #define CLK_PIN 3 15 | #define PWM_PIN 4 16 | 17 | uint8_t Byte,i,j,WH,WL; 18 | uint16_t Data[12]; 19 | uint16_t DataVF[12]; 20 | 21 | #if(DEBUG) 22 | char buffer[80]; 23 | #endif 24 | 25 | void config_pwm_out() 26 | { 27 | pinMode(PWM_PIN,OUTPUT); 28 | digitalWrite(PWM_PIN,LOW); 29 | } 30 | 31 | void config_pwm_in() 32 | { 33 | digitalWrite(PWM_PIN,LOW); 34 | pinMode(PWM_PIN,INPUT); 35 | } 36 | 37 | void setup() 38 | { 39 | Serial.begin(9600); 40 | 41 | pinMode(LED_PIN,OUTPUT); 42 | digitalWrite(LED_PIN,LOW); 43 | 44 | pinMode(VDD_PIN,OUTPUT); 45 | digitalWrite(VDD_PIN,LOW); 46 | 47 | pinMode(CLK_PIN,OUTPUT); 48 | digitalWrite(CLK_PIN,LOW); 49 | 50 | config_pwm_out(); 51 | 52 | digitalWrite(LED_PIN,HIGH); 53 | delay(100); 54 | digitalWrite(LED_PIN,LOW); 55 | } 56 | 57 | void loop() 58 | { 59 | if(Serial.available()) 60 | { 61 | if(Serial.readBytes(&Byte,1)) 62 | { 63 | if(Byte=='!') 64 | { 65 | digitalWrite(LED_PIN,HIGH); 66 | Serial.println("!Arduino HCS301 Programmer V0.1"); 67 | digitalWrite(LED_PIN,LOW); 68 | } 69 | else if(Byte=='>') 70 | { 71 | digitalWrite(LED_PIN,HIGH); 72 | delay(150); 73 | for(i=0;i<12;i++) 74 | { 75 | Serial.readBytes(&WH,1); 76 | Serial.readBytes(&WL,1); 77 | Data[i]=(WH<<8)|WL; 78 | } 79 | 80 | #if(DEBUG) 81 | sprintf(buffer,">j)&0x0001)digitalWrite(PWM_PIN,HIGH); 102 | else digitalWrite(PWM_PIN,LOW); 103 | digitalWrite(CLK_PIN,HIGH); 104 | delayMicroseconds(100); 105 | digitalWrite(CLK_PIN,LOW); 106 | delayMicroseconds(100); 107 | } 108 | digitalWrite(PWM_PIN,LOW); 109 | if(i==11)config_pwm_in(); 110 | delay(60); 111 | } 112 | 113 | for(i=0;i<12;i++) 114 | { 115 | DataVF[i]=0; 116 | for(j=0;j<16;j++) 117 | { 118 | digitalWrite(CLK_PIN,HIGH); 119 | DataVF[i]|=((digitalRead(PWM_PIN))?1:0)<