Eagle ke FlatCam JLCPCB atau PCBWAY

Panduan cepat untuk mengekspor desain PCB dari Eagle dan mengimpornya ke FlatCAM. Panduan ini dibuat dengan Eagle versi 7.2.0 Light dan FlatCAM 8.2.

Sebagian besar desain dimulai dengan skema rangkaian:

Kemudian dengan meng-klik File→Switch to board, editor papan PCB terbuka dan kemudian menyelesaikan tata letak rangkaian:

Untuk ekspor file cam bor, buka File→CAM Processor lagi dan pilih setelan pada gambar di bawah. Pilih EXCELLON_24 untuk bagian Device. Berikan ekstensi drills.drd pada nama file bor jika perlu. Klik Proses Job untuk mengekspor.

Kita sudah selesai dengan Eagle. Sekarang mari beralih ke FlatCAM.

Eagle menggunakan Trailing Zeros dalam format angka Excellon, format ini perlu dilaporkan dengan benar di FlatCaM dengan cara berikut:

_images/eagle_example_5.png

Perubahan pada opsi sistem akan disetel saat memulai ulang, maka FlatCam perlu dijalankan ulang.

Sekarang cukup buka file Gerber dan Excellon yang diekspor dari Eagle.

Cara setting flatmac dapat dilihat di artikel berikut:

Sumber: http://flatcam.org/manual/eaglehowto.html

Jika ingin mengekspor untuk file gerber di layanan produsen PCB semisal JLCPCB atau PCBWAY, gunakan file konfigurasi CAM berikut: Cara Setting FlatCAM

  1. CAM JLCPCB
  2. CAM PCBWAY

Fix ampersamp in syntaxhighlighter

This can be done directly from the webinterface. Just go to Plugins -> Plugin Editor -> select the Plugin SyntaxHighlighter Evolved -> add the snippet to the end

/**
 * Filter to fix issue with & in SyntaxHighlighter Evolved plugin.
 *
 * @param string $code Code to format.
 * @param array $atts Attributes.
 * @param string $tag Tag.
 *
 * @return string
 */
function kagg_syntaxhighlighter_precode( $code, $atts, $tag ) {
    if ( 'code' === $tag ) {
        $code = wp_specialchars_decode( $code );
    }
    return $code;
}
add_filter( 'syntaxhighlighter_precode', 'kagg_syntaxhighlighter_precode', 10, 3 );

Sumber: https://nocin.eu/wordpress-syntaxhighlighter-ampersand-character/

Antarmuka Port Serial dengan C++

Gunakan Class Serial berikut:

//File: Serial.h
#ifndef SERIALCLASS_H_INCLUDED
#define SERIALCLASS_H_INCLUDED

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

class Serial
{
    private:
        //Serial comm handler
        HANDLE hSerial;
        //Connection status
        bool connected;
        //Get various information about the connection
        COMSTAT status;
        //Keep track of last error
        DWORD errors;

    public:
        //Initialize Serial communication with the given COM port
        Serial(char *portName);
        //Close the connection
        ~Serial();
        //Read data in a buffer, if nbChar is greater than the
        //maximum number of bytes available, it will return only the
        //bytes available. The function return -1 when nothing could
        //be read, the number of bytes actually read.
        int ReadData(char *buffer, unsigned int nbChar);
        //Writes data from a buffer through the Serial connection
        //return true on success.
        bool WriteData(char *buffer, unsigned int nbChar);
        //Check if we are actually connected
        bool IsConnected();


};

#endif // SERIALCLASS_H_INCLUDED

//File: Serial.cpp
#include "Serial.h"

Serial::Serial(char *portName)
{
    //We're not yet connected
    this->connected = false;

    //Try to connect to the given port throuh CreateFile
 #if _MSC_VER && !__INTEL_COMPILER
    const size_t cSize = strlen(portName) + 1;
    wchar_t* wc = new wchar_t[cSize];
    mbstowcs_s(NULL, wc, cSize, portName, cSize);
    this->hSerial = CreateFile(wc,
        GENERIC_READ | GENERIC_WRITE,
        0,
        NULL,
        OPEN_EXISTING,
        FILE_ATTRIBUTE_NORMAL,
        NULL);
#else
    //Try to connect to the given port throuh CreateFile
    this->hSerial = CreateFile(portName,
        GENERIC_READ | GENERIC_WRITE,
        0,
        NULL,
        OPEN_EXISTING,
        FILE_ATTRIBUTE_NORMAL,
        NULL);
#endif

    //Check if the connection was successfull
    if(this->hSerial==INVALID_HANDLE_VALUE)
    {
        //If not success full display an Error
        if(GetLastError()==ERROR_FILE_NOT_FOUND){

            //Print Error if neccessary
            printf("ERROR: Handle was not attached. Reason: %s not available.\n", portName);

        }
        else
        {
            printf("ERROR!!!");
        }
    }
    else
    {
        //If connected we try to set the comm parameters
        DCB dcbSerialParams = {0};

        //Try to get the current
        if (!GetCommState(this->hSerial, &dcbSerialParams))
        {
            //If impossible, show an error
            printf("failed to get current serial parameters!");
        }
        else
        {
            //Define serial connection parameters for the arduino board
            dcbSerialParams.BaudRate=CBR_9600;
            dcbSerialParams.ByteSize=8;
            dcbSerialParams.StopBits=ONESTOPBIT;
            dcbSerialParams.Parity=NOPARITY;
            //Setting the DTR to Control_Enable ensures that the Arduino is properly
            //reset upon establishing a connection
            dcbSerialParams.fDtrControl = DTR_CONTROL_ENABLE;

             //Set the parameters and check for their proper application
             if(!SetCommState(hSerial, &dcbSerialParams))
             {
                printf("ALERT: Could not set Serial Port parameters");
             }
             else
             {
                 //If everything went fine we're connected
                 this->connected = true;
                 //Flush any remaining characters in the buffers
                 PurgeComm(this->hSerial, PURGE_RXCLEAR | PURGE_TXCLEAR);
                 //We wait 2s as the arduino board will be reseting
                 Sleep(2000);
             }
        }
    }

}

Serial::~Serial()
{
    //Check if we are connected before trying to disconnect
    if(this->connected)
    {
        //We're no longer connected
        this->connected = false;
        //Close the serial handler
        CloseHandle(this->hSerial);
    }
}

int Serial::ReadData(char *buffer, unsigned int nbChar)
{
    //Number of bytes we'll have read
    DWORD bytesRead;
    //Number of bytes we'll really ask to read
    unsigned int toRead;

    //Use the ClearCommError function to get status info on the Serial port
    ClearCommError(this->hSerial, &this->errors, &this->status);

    //Check if there is something to read
    if(this->status.cbInQue>0)
    {
        //If there is we check if there is enough data to read the required number
        //of characters, if not we'll read only the available characters to prevent
        //locking of the application.
        if(this->status.cbInQue>nbChar)
        {
            toRead = nbChar;
        }
        else
        {
            toRead = this->status.cbInQue;
        }

        //Try to read the require number of chars, and return the number of read bytes on success
        if(ReadFile(this->hSerial, buffer, toRead, &bytesRead, NULL) && bytesRead != 0)
        {
            return bytesRead;
        }

    }

    //If nothing has been read, or that an error was detected return -1
    return -1;

}


bool Serial::WriteData(char *buffer, unsigned int nbChar)
{
    DWORD bytesSend;

    //Try to write the buffer on the Serial port
    if(!WriteFile(this->hSerial, (void *)buffer, nbChar, &bytesSend, 0))
    {
        //In case it don't work get comm error and return false
        ClearCommError(this->hSerial, &this->errors, &this->status);

        return false;
    }
    else
        return true;
}

bool Serial::IsConnected()
{
    //Simply return the connection status
    return this->connected;
}


Berikut contoh koneksi pengiriman data

#include <iostream>
#include "windows.h"
#include "Serial.h"

#include <thread>
#include <chrono>

using namespace std;

void delay(int ms){
    std::this_thread::sleep_for (std::chrono::milliseconds(ms));
}

int main(int argc, char** argv) {

    char alamatPort[] = "\\\\.\\COM7";
    Serial* s = new Serial(alamatPort);

	char dataOn[256] = "on1\n"; //"Nyala!";
	char dataOff[256] = "off0\n"; //"mati!";

	cout<<"isikan angka 1 untuk menyalakan, atau 0 untuk mematikan"<<endl;


	int jawab;
	do{
        cin>>jawab;;

        if(jawab==0)
            s->WriteData(dataOff, sizeof(dataOff));
        if(jawab==1)
            s->WriteData(dataOn, sizeof(dataOn));
        if(jawab==2)
            for(int a=0;a<5;a++){
                s->WriteData(dataOn, sizeof(dataOn));
                delay(500);
                s->WriteData(dataOff, sizeof(dataOff));
                delay(500);
            }
	}while(jawab<3);

	return 0;
}

Berikut contoh untuk mengirim dan menerima data

#include <iostream>
#include <stdio.h>
#include <tchar.h>
#include "Serial.h" // Library described above
#include <string>


/* run this program using the console pauser or add your own getch, system("pause") or input loop */
char alamatPort[] = "\\\\.\\COM7";
Serial* SP = new Serial(alamatPort);    // adjust as needed

void* baca(void* data)
{

    char incomingData[256] = "";            // don't forget to pre-allocate memory
    //printf("%s\n",incomingData);
    int dataLength = 256;
    int readResult = 0;


    while (SP->IsConnected())
    {
        readResult = SP->ReadData(incomingData, dataLength);
        if (readResult > 0) {
            printf("%s\n", incomingData);
        }
        //printf("Bytes read: (-1 means no data available) %i\n",readResult);

        //std::string test(incomingData);

        //printf("%s",incomingData);
        //test = "";

        Sleep(500);
    }
    return NULL;
}

void* tulis(void* data)
{
    while (SP->IsConnected())
    {
        char outgoingData[256] = "";
        char keluar[256] = "keluar";
        int dataLength = sizeof(outgoingData);        // don't forget to pre-allocate memory
        scanf_s("%255s", outgoingData, dataLength);

        if (outgoingData != "")
        {
            if (strcmp(outgoingData, "OK") == 0) {
                printf("Pengiriman selesai\n");
                return NULL;

            }
            if (SP->WriteData(outgoingData, dataLength))
            {
                printf("Data send:%s\n", outgoingData);
            }
        }

        Sleep(500);
    }
    // do stuff...
    return NULL;
}

#if _MSC_VER && !__INTEL_COMPILER
#include <thread>

int main(int argc, char** argv) {
    printf("Welcome to the serial test app!\n\n");
    if (SP->IsConnected())
        printf("Serial sudah terhubung\n");
    int status;
    std::thread thrd_1(baca,(void*)0);
    std::thread thrd_2(tulis, (void*)0);

    thrd_1.join();
    thrd_2.join();

}
#else
// thread example
#include <pthread.h>

int main(int argc, char** argv) {
    printf("Welcome to the serial test app!\n\n");
    if (SP->IsConnected())
        printf("Serial sudah terhubung\n");

    pthread_t thrd_1;
    pthread_t thrd_2;
    int status;

    pthread_create(&thrd_1, NULL, baca, (void*)0);
    pthread_create(&thrd_2, NULL, tulis, (void*)0);

    pthread_join(thrd_1, (void**)&status);
    pthread_join(thrd_2, (void**)&status);

    printf("Terima kasih");

    return 0;
}
#endif

TL494C not TL949

by https://e2e.ti.com/members/5183115

C1 220uF 50V
C2 220uF 50V
C3 1uF
C4 220uF 50V
C5 220uF 50V
C6 1uF
C7 1uF
C8 100nF
C9 100nF
C10 1uF(recommended to increase it to improve soft start)
C11 Not Applicable
C12 100nF
C13 1nF
C14 100nF
C15 100nF
C16 100nF
C17 1nF
D1 SS54
D2 MBR20100CS
G1 NCE6075
L1 47uH
Q1 D884
Q2 Y1
Q3 Y2
R1 Not Applicable
R2 4K3
R3 15K
R4 Not Applicable
R5 1K5
R6 10K
R7 10K
R8 10K (recommended to increase it to improve soft start)
R9 10K
R10 22R
R11 1K
R12 4R7
R13 240K
R14 Not Applicable
R15 22R
R16 10K
R17 1K
R18 0R
R19 0R01
RV1 10K
RV2 5K
U1 TL494C
ZD1 WL

Kode warna dioda

Kode warna dioda

MELF/mini-MELF/LL-34 Package Diodes

The SOD-80 package, also known as mini-MELF, is a small ( glass, sometimes plastic) cylinder with metal ends.

MELF package L=4.9mm D=2.5mm
mini-MELF (SOD80C) L=3.5mm D=1.6mm
LL-34 L=3.4mm D= 1.4mm

sod-80 package diagram

Code marked devices

Marked 2Y4 to 75Y (E24 series) BZV49 series 1W zener diodes (2.4 – 75V)

Marked C2V4 TO C75 (E24 series) BZV55 series 500mW zener diodes (2.4 – 75V)

The cathode end is indicated by a coloured band.


Coloured band marked devices (MELF/SOD-80)

CATHODE BAND(S)Device
BlackBAS32, BAS45, BAV105 LL4148, 50, 51,53, LL4448 BB241,BB249
Black BrownLL4148, LL914
Black OrangeLL4150, BB219
Brown GreenLL300
Brown BlackLL4448
RedBA682
Red OrangeBA683
Red GreenBA423L
Red WHiteLL600
Orange YellowLL3595
YellowBZV55,BZV80,BZV81 series zeners
GreenBAV105, BB240
Green BlackBAV100
Green BrownBAV101
Green RedBAV102
Green OrangeBAV103
GreyBAS81, 82, 83, 85, 86
WhiteBB219
White GreenBB215

Some manufacturers have a generic type coding scheme for MELF and mini-MELF diodes.
That for Vishay/General Semiconductor is shown below:

CATHODE BANDMini MELF Device Type
BlackGeneral purpose
YellowSwitching
GreenSchottky
BlueZener
CATHODE BANDMELF Device Type
BlackZener
GreenSchottky

Rohm LL-34 package Zener Diodes RLZ Series
Three band colour code Third band is always Green

Type1st Band2nd Band3rd BandType1st Band2nd Band3rd Band
RLZ3.6BBlackPurpleGreenRLZ12BRedBlackGreen
RLZ3.9BBlackGrayGreenRLZ13BRedBrownGreen
RLZ4.3BBrownWhiteGreenRLZ15BRedRedGreen
RLZ4.7BBrownBlackGreenRLZ16BRedOrangeGreen
RLZ5.1BBrownBrownGreenRLZ18BRedYellowGreen
RLZ5.6BBrownRedGreenRLZ20BRedGreenGreen
RLZ6.2BBrownOrangeGreenRLZ22BRedBlueGreen
RLZ6.8BBrownYellowGreenRLZ24BRedPurpleGreen
RLZ7.5BBrownGreenGreenRLZ27BRedGrayGreen
RLZ8.2BBrownBlueGreenRLZ30BRedWhiteGreen
RLZ9.1BBlackPurpleGreenRLZ33BOrangeBlackGreen
RLZ10BBlackGrayGreenRLZ36BOrangeBrownGreen
RLZ11BBlackWhiteGreenRLZ39BOrangeRedGreen

MELF/mini-MELF/LL-34 Package Diodes

The SOD-80 package, also known as mini-MELF, is a small ( glass, sometimes plastic) cylinder with metal ends.

MELF package L=4.9mm D=2.5mm
mini-MELF (SOD80C) L=3.5mm D=1.6mm
LL-34 L=3.4mm D= 1.4mm


Code marked devices

Marked 2Y4 to 75Y (E24 series) BZV49 series 1W zener diodes (2.4 – 75V)

Marked C2V4 TO C75 (E24 series) BZV55 series 500mW zener diodes (2.4 – 75V)

The cathode end is indicated by a coloured band.


Coloured band marked devices (MELF/SOD-80)

CATHODE BAND(S)Device
BlackBAS32, BAS45, BAV105 LL4148, 50, 51,53, LL4448 BB241,BB249
Black BrownLL4148, LL914
Black OrangeLL4150, BB219
Brown GreenLL300
Brown BlackLL4448
RedBA682
Red OrangeBA683
Red GreenBA423L
Red WHiteLL600
Orange YellowLL3595
YellowBZV55,BZV80,BZV81 series zeners
GreenBAV105, BB240
Green BlackBAV100
Green BrownBAV101
Green RedBAV102
Green OrangeBAV103
GreyBAS81, 82, 83, 85, 86
WhiteBB219
White GreenBB215

Some manufacturers have a generic type coding scheme for MELF and mini-MELF diodes.
That for Vishay/General Semiconductor is shown below:

CATHODE BANDMini MELF Device Type
BlackGeneral purpose
YellowSwitching
GreenSchottky
BlueZener
CATHODE BANDMELF Device Type
BlackZener
GreenSchottky

Rohm LL-34 package Zener Diodes RLZ Series
Three band colour code Third band is always Green

Type1st Band2nd Band3rd BandType1st Band2nd Band3rd Band
RLZ3.6BBlackPurpleGreenRLZ12BRedBlackGreen
RLZ3.9BBlackGrayGreenRLZ13BRedBrownGreen
RLZ4.3BBrownWhiteGreenRLZ15BRedRedGreen
RLZ4.7BBrownBlackGreenRLZ16BRedOrangeGreen
RLZ5.1BBrownBrownGreenRLZ18BRedYellowGreen
RLZ5.6BBrownRedGreenRLZ20BRedGreenGreen
RLZ6.2BBrownOrangeGreenRLZ22BRedBlueGreen
RLZ6.8BBrownYellowGreenRLZ24BRedPurpleGreen
RLZ7.5BBrownGreenGreenRLZ27BRedGrayGreen
RLZ8.2BBrownBlueGreenRLZ30BRedWhiteGreen
RLZ9.1BBlackPurpleGreenRLZ33BOrangeBlackGreen
RLZ10BBlackGrayGreenRLZ36BOrangeBrownGreen
RLZ11BBlackWhiteGreenRLZ39BOrangeRedGreen

Gender Konektor DB9 pada RS232

DTE vs DCE

DTE adalah Data Terminal Equipment, dimana sumbaer data dan pengolahannya ada di bagian ini. Untuk koneksi SPI ini dinamakan Master. Sedangkan DCE atau Data Circuit terminating Equipment adalah perangkat periferal dari DTE. Ini dinamakan Slave pada antarmuka SPI.

DTE dan DCE

Gender koneksi DTE dibanding DCE

Pada koneksi DTE dalam banyak kasus biasanya jenis MALE, sedangkan untuk DCE adalah yang female. Namun tidak semuanya seperti ini, harus pintar membaca petunjuk atau datasheet.

Image result for de-9 pinout female male
Male untuk DTE dan Female untuk DCE

Pinout

Untuk koneksi RS232 dasar, biasanya hanya perlu Rx, Tx dan Ground. Beberapa peralatan mungkin memerlukan pin kontrol tambahan. Berikut bagaimana pengaturan pin menempatkan Tx ke Rx, DTR ke DSR, dan RTS ke CTS.

Pinout DB9 pada RS232 untuk Male (DTE) dan Female (DCE)

Contoh modul untuk DTE dan DCE

테크 선전 아두이노, 라즈베리파이, 마이크로비트
Modul untuk DCE dengan konektor Female
Amazon.com: NulSom Inc. Ultra Compact RS232 to TTL ...
Modul untuk DTE dengan konektor Male

Null Modem

Null modem dibutuhkan untuk koneksi DTE ke DTE (Male – Male) atau DCE ke DCE (Female-Female)

RS232 cable
Null Modem untuk Male to Male (DTE to DTE)