Author |
Message |
Topic: How to use invert bit in define command by macro |
huynhhai
Replies: 7
Views: 22741
|
Forum: General CCS C Discussion Posted: Sun Feb 13, 2022 11:16 pm Subject: How to use invert bit in define command by macro |
Thank you very much for you help, i solved it by changed code in programs (changed library).
Regards,
huynhhai |
Topic: How to use invert bit in define command by macro |
huynhhai
Replies: 7
Views: 22741
|
Forum: General CCS C Discussion Posted: Fri Feb 11, 2022 10:30 pm Subject: How to use invert bit in define command by macro |
I can use macro to write code on command #define such as output_toggle(),
Regards |
Topic: How to use invert bit in define command by macro |
huynhhai
Replies: 7
Views: 22741
|
Forum: General CCS C Discussion Posted: Fri Feb 11, 2022 9:05 pm Subject: How to use invert bit in define command by macro |
Hi Everyone,
I had one a hardware, now i want to write code to use it, (my PIC16F886)
in the define line: #define led PIN_C5
the code in my program:
output_high(led); --> PIN_C5 will co ... |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Thu May 20, 2021 10:17 am Subject: Modbus master RTU issue with long distance |
Thanks Ttelmah,
Now, my system with modbus are running good and no error, i checked all issue after my project as below:
1. If Slave board, i can use TTL to RS485 module (only two pin TX and RX) b ... |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Sat May 08, 2021 9:59 am Subject: Modbus master RTU issue with long distance |
Thanks for your help,
I found out the reason for master can not transceiver to slave due to opto isolate, from master PIC board have used Opto EL817 ( this is photo transistor NOT IS A LOGIC PHOTO ... |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Wed May 05, 2021 2:36 am Subject: Modbus master RTU issue with long distance |
Dear Ttelmah, alan
I removed resistor already but unsuccessful.
I will change my module with DE and RE module to test again.
When the master sent data to slave, i observed led TX signal blinking ... |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Wed May 05, 2021 1:26 am Subject: Modbus master RTU issue with long distance |
Dear Ttelmah,
This module i got from supplier of china,
https://shopee.vn/Module-TTL-to-RS485-i.104103144.4673294905
At the moment in my boards i used TTL to RS485 ( mean no pin DE and RE ) wh ... |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Wed May 05, 2021 12:10 am Subject: Modbus master RTU issue with long distance |
Today, i tried to increase the time timeout =100ms reponse to connect master and slave, and the time read data between two slaves is 10ms.
At the time i used delay to read data from master to slaves ... |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Tue May 04, 2021 11:55 am Subject: Modbus master RTU issue with long distance |
please see module rs485
1. USB module
https://1drv.ms/u/s%21AlOlL_PaiWSVj5MB2oLId4VypF93oQ?e=xtltKy
2. rs485 module on PIC board
https://1drv.ms/u/s%21AlOlL_PaiWSVj5MCEyX0VSC9GF9AoQ?e=rvbcqm |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Tue May 04, 2021 10:28 am Subject: Modbus master RTU issue with long distance |
Thanks dluu13,
The Master i put middle of the string,
and i used module usb to rs485 to tested at the same position with pc modbus poll tool is ok. |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Tue May 04, 2021 10:22 am Subject: Modbus master RTU issue with long distance |
Dear dluu13, Ttelmah
For network i used "backbone with stubs" about 9 slave and 1 master.
I connected with two resistors 120 ohm the end of two lines.
I tested the baudrate to 1200bp ... |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Tue May 04, 2021 10:03 am Subject: Modbus master RTU issue with long distance |
Thank you very much,
For cable i used Altek cable 22AWG 1 pair shield, about 9 slaves (read status run-stop) and 1 master.
The master read step by step from slave 1 to slave 9, the time for read ... |
Topic: Modbus master RTU issue with long distance |
huynhhai
Replies: 21
Views: 56970
|
Forum: General CCS C Discussion Posted: Tue May 04, 2021 8:30 am Subject: Modbus master RTU issue with long distance |
Hi Every one,
I had two boards, 1 master using PIC18F67K22 and 1 Slave using PIC16F887. To read input, i wrote code as example "ex_modbus_slave.c " and "EX_MODBUS_MASTER.C ", t ... |
Topic: Driver control LCD TFT 320QVT ili9341 |
huynhhai
Replies: 3
Views: 46806
|
Forum: Code Library Posted: Sat Sep 09, 2017 9:48 am Subject: Driver control LCD TFT 320QVT ili9341 |
touch7843.c file
#include <touch7843.h>
#include <tft320qvt_9341.h>
int16 vx=15489,vy=11106;
int16 chx=199,chy=3871;
struct tp_pix_ tp_pixad,tp_pixlcd;
int8 tpstate ... |
Topic: Driver control LCD TFT 320QVT ili9341 |
huynhhai
Replies: 3
Views: 46806
|
Forum: Code Library Posted: Sat Sep 09, 2017 9:43 am Subject: Driver control LCD TFT 320QVT ili9341 |
Hi everyone,
i used PIC18F4620, hardware as config in software
main.h file
//--------------------------------
#include <18F4620.h>
//STATUS = FD8H
#device PASS_STRINGS=IN_RAM
#devi ... |
|