harold 发表于 2018-6-7 19:40:37

多谢分享,看起来很好用的样子

szxszx 发表于 2018-6-16 14:57:19

pic_flash 发表于 2016-12-4 10:27
PIC 编译器, CCS C
版本: PCWHD_V5.065(PIC 编译器)



楼主,你好。请问串口发送9bit数据函数是哪个?

harold 发表于 2018-6-17 00:12:44

szxszx 发表于 2018-6-16 14:57
楼主,你好。请问串口发送9bit数据函数是哪个?

#pragma use rs232(baud=9600, bits = 9, xmit=PIN_C6, rcv=PIN_C7)

szxszx 发表于 2018-6-17 09:13:15

harold 发表于 2018-6-17 00:12
#pragma use rs232(baud=9600, bits = 9, xmit=PIN_C6, rcv=PIN_C7)

谢谢,这个是预编译的参数。我想问一下是哪个函数?下面例子可行吗?

void SendData(unsigned char Data)
{
        TX9D = 1;      //第9位需要先赋值?
      putc(Data);   
}

pic_flash 发表于 2018-6-17 12:55:37

szxszx 发表于 2018-6-16 14:57
楼主,你好。请问串口发送9bit数据函数是哪个?

#use rs232(baud=9600, bits = 9, xmit=PIN_C6, rcv=PIN_C7, errors)
这个就可以了。。

建议看Help, 还有很多附加功能, 比如延时,Timeout , received buffer之类的

pic_flash 发表于 2018-6-17 12:56:45

szxszx 发表于 2018-6-17 09:13
谢谢,这个是预编译的参数。我想问一下是哪个函数?下面例子可行吗?

void SendData(unsigned char Data ...

应该不需要的

szxszx 发表于 2018-6-17 13:11:14

pic_flash 发表于 2018-6-17 12:56
应该不需要的

在多机通讯中,第9位用于表示是地址还是数据,可能是1或0,应该要先赋值

chenhu2012 发表于 2018-6-23 16:58:18

我来看看楼主。{:handshake:}

chenhu2012 发表于 2018-7-10 17:14:05


我来看看楼主。{:smile:}

chenhu2012 发表于 2018-7-20 08:21:28

{:handshake:}
我来看看楼主。

miscell 发表于 2018-7-29 21:24:53

楼主有没最新版的CCS

pic_flash 发表于 2018-7-31 08:57:14

miscell 发表于 2018-7-29 21:24
楼主有没最新版的CCS

PIC 编译器, CCS C
版本: PCWHD_V5.079(PIC 编译器)
链接:https://pan.baidu.com/s/1GPWtqV-v-S7xwWftp3Hliw
密码:q1fi

gmyu 发表于 2018-7-31 09:33:23

这次更新了什么?

pic_flash 发表于 2018-7-31 10:47:09

gmyu 发表于 2018-7-31 09:33
这次更新了什么?

5.079A problem with some interrupts on the K42 parts starting in the wrong bank is fixed
5.079A problem with the IDE finding units when the output directory is specified is fixed
5.079A wrong warning 227 on some chips and options is fixed
5.079The ++ operator when used on multi-byte fields in a packed structure sometimes did not work
5.079A PIC24 optimization issues was fixed related to integer to float conversion
5.079A PCH problem with function pointers inside structures for some syntaxes is fixed
5.079A fix was made for dual partition mode
5.079Fixed restart_wdt() for devices with a WWDT and window is set to less then 100 percent
5.079Fixed issue with port_x_pullup() function not clearing WPUEN bit for some chips

miscell 发表于 2018-7-31 11:07:02

谢谢热心的楼主!

zhanyanqiang 发表于 2018-7-31 13:01:29

PIC32MZ2408   支持吗???

pic_flash 发表于 2018-7-31 16:24:26

zhanyanqiang 发表于 2018-7-31 13:01
PIC32MZ2408   支持吗???

CCS C 目前不支持任何的PIC32。。

chenhu2012 发表于 2018-8-2 14:32:29

LZ威武!!!

mathison 发表于 2018-8-9 12:48:59

CCS C 下,有成功跑protothreads 的吗,发现在PICC 9.83 Pro下跑起来 有异常

pic_flash 发表于 2018-8-9 18:44:03

mathison 发表于 2018-8-9 12:48
CCS C 下,有成功跑protothreads 的吗,发现在PICC 9.83 Pro下跑起来 有异常

我个人没有用过, 但是有人移值到CCS C, 没有后续的跟进, 有没有问题不知道, 根据移植的作者说,CCS C 并不能很好的支持原创的代码, 他是经过一番修改。

/******************************************************************************
* NAME:protothreads.h
* AUTH:Jeremiah (Reworked from Adam Dunkel's code)
* DESC:Provides a stackless, OS-less, low RAM implementation of cooperative
*      multithreading for the CCS compiler environment.Based off of the
*      protothreads library provided by Adam Dunkel, but with modifications
*      for the CCS compiler environment.Specifically:
*         1. CCS doesn't support local continuations, so compiler extensions
*            are used instead.label_address() and goto_address()
*         2. Removal of do{}while() loops as they generate compiler warnings
*            and are not needed for CCS.
*         3. Changed PT_END() and PT_EXIT() to not reset the local
*            continuation but instead remember the thread finished.
*         4. Re-orged a few macros to better optimize with CCS.
*         5. Changed PT_YIELD_FLAG=0 to PT_YIELD_FLAG=PT_YIELD_FLAG in the
*            PT_END() macro
*         6. Removed PT_THREAD() and replaced it with pt_ret_t
*         7. Added (and defaulted to) the use of reference parameters since
*            those provide less code in most general scenarios.A #define
*            can be commented out to go back to pointers.
*      Copyright notice from Adam Dunkels code provided near the end of the
*      file.
*
*      TYPES:
*         pt_t   - Protothread context type
*         pt_ret_t - Protothread return type
*                        PT_WAITING - Thread is waiting/blocking
*                        PT_YIELDED - Thread yielded
*                        PT_EXITED- Thread ended abnormally
*                        PT_ENDED   - Thread ended normally
*         pt_sem_t - Protothread semiphore type
*
*      MACROS:
*         PT_INIT()- Must be called prior to scheduling a thread
*         PT_BEGIN() - Must be called at the beginning of a protothread.
*         PT_END()   - Must be called at the end of a protothread (once)
*         PT_WAIT_WHILE() - Used to block a thread while a condition is TRUE
*         PT_WAIT_UNTIL() - Used to block a thread until a condition is TRUE
*         PT_YIELD()       - Yields the current thread
*         PT_YIELD_WHILE() - Yields current thread while a condition is TRUE
*         PT_YIELD_UNTIL() - Yields current thread until a condition is TRUE
*         PT_RESTART() - Restarts the current thread
*         PT_EXIT()    - Exits the current thread
*         PT_SCHEDULE()    - Schedules a thread from a non-thread method
*         PT_WAIT_THREAD() - Spawns a child thread and waits on it to end
*         PT_SPAWN()       - Same as PT_WAIT_THREAD() but with PT_INIT()
*         PT_SEM_INIT()   - Initializes a semiphore
*         PT_SEM_WAIT()   - Waits on a semiphore signal (decrements count)
*         PT_SEM_SIGNAL() - Sends a semiphore signal (increments count)
*
* COMPILED WITH:CCS PCWHD Revision 5.025
*
* HISTORY:
* 02/20/2014 - JHB - Creation
******************************************************************************/
#ifndef PROTOTHREADS_H
#define PROTOTHREADS_H
#nolist

///////////////////////////////////////////////////////////////////////////////
//***************** File Option Settings ************************************//
///////////////////////////////////////////////////////////////////////////////
//CCS specific - for use with reference parameters vs pointer parameters
#define PT_USE_REFERENCES//comment this line out to use pointers
#if defined(PT_USE_REFERENCES)
#define PT_STRUCT_ELEM(st, e) ((st).e)
#else
#define PT_STRUCT_ELEM(st, e) ((st)->e)
#endif


///////////////////////////////////////////////////////////////////////////////
//***************** Local Continuations (Compiler Specific) *****************//
///////////////////////////////////////////////////////////////////////////////
//This section sets up some macros used by the protothreads interface.These
//macros should not be used directly.They are merely tools for the
//protothreads interface.

//Variable typedef
#if defined(__PCH__) || defined(__PCD__)
typedef unsigned int32 lc_t;
#else
typedef unsigned int16 lc_t;
#endif

//Used to reset the local continuation
#define LC_INIT(lc) lc = 0

//Place in PT_BEGIN()
#define LC_RESUME(lc) if(0 != lc){goto_address(lc);}

//Used to create continuations
#define LC_CONCAT_INNER(s1,s2) s1##s2
#define LC_CONCAT(s1,s2) LC_CONCAT_INNER(s1,s2)
#define LC_SET(lc)                                    \
   LC_CONCAT(LC_LABEL, __LINE__):                     \
   (lc) = label_address(LC_CONCAT(LC_LABEL,__LINE__))

//Place in PT_END()
#define LC_END(lc)

///////////////////////////////////////////////////////////////////////////////
//***************** Protothreads Interface **********************************//
///////////////////////////////////////////////////////////////////////////////
//This is the meat of the file.Macros from here will be used to create and
//manage protothreads.

//Variable Typedefs
typedef struct{
   lc_t lc;
} pt_t;

typedef enum{
   PT_WAITING = 0,
   PT_YIELDED = 1,
   PT_EXITED= 2,
   PT_ENDED   = 3
} pt_ret_t;


///////////////////////////////////////////////////////////////////////////////
// NAME: PT_INIT
// DESC: Initializes the control structure for a protothread.Must be called
//       prior to calling the thread.
// IN:   pt - protothread control structure
// OUT:NONE
// NOTE: Example:
//       pt_ret_t thread(pt_t &pt);
//       void main(){
//          pt_t pt;
//          PT_INIT(pt);
//          while(TRUE){PT_SCHEDULE(thread(pt));}
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_INIT(pt)LC_INIT(PT_STRUCT_ELEM(pt,lc))

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_BEGIN
// DESC: Starts the control code for a thread.Must be called after variable
//       declarations and before function program code
// IN:   pt - protothread control structure
// OUT:NONE
// NOTE: Example:
//       pt_ret_t thread(pt_t &pt){
//          static int variable;
//          PT_BEGIN(pt);
//          variable = 10;
//          //do stuff here
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_BEGIN(pt) int1 PT_YIELD_FLAG = 1;LC_RESUME(PT_STRUCT_ELEM(pt,lc))

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_END
// DESC: Ends the control code for a thread.Must be called at the end of
//       of a protothread.Leaves the tread with the PT_ENDED status.
// IN:   pt - protothread control structure
// OUT:NONE
// NOTE: Example:
//       pt_ret_t thread(pt_t &pt){
//          PT_BEGIN(pt);
//          //do stuff here
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_END(pt)   LC_SET(PT_STRUCT_ELEM(pt,lc)); \
   LC_END(PT_STRUCT_ELEM(pt,lc));   PT_YIELD_FLAG = PT_YIELD_FLAG;\
   return PT_ENDED

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_WAIT_WHILE
// DESC: Blocks the current thread while a supplied condition is true
// IN:   pt - protothread control structure
//       condition - condition that causes blocking
// OUT:NONE
// NOTE: Example:
//       int g_variable = 0;
//       pt_ret_t thread(pt_t &pt){
//          PT_BEGIN(pt);
//          PT_WAIT_WHILE(0 == g_variable);
//          //do stuff here
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_WAIT_WHILE(pt, condition)   \
   LC_SET(PT_STRUCT_ELEM(pt,lc));if(condition) { return PT_WAITING;}

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_WAIT_UNTIL
// DESC: Blocks the current thread until a supplied condition becomes true
// IN:   pt - protothread control structure
//       condition - condition that ends blocking
// OUT:NONE
// NOTE: Example:
//       int g_variable = 0;
//       pt_ret_t thread(pt_t &pt){
//          PT_BEGIN(pt);
//          PT_WAIT_UNTIL(0 != g_variable);
//          //do stuff here
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_WAIT_UNTIL(pt, condition)   PT_WAIT_WHILE(pt, !(condition))

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_YIELD
// DESC: Yields the current thread
// IN:   pt - protothread control structure
// OUT:NONE
// NOTE: Example:
//       pt_ret_t thread(pt_t &pt){
//          static int16 i;
//          PT_BEGIN(pt);
//          for(i=0; i<10000; i++){
//             //do something
//             PT_YIELD(pt);
//          }
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_YIELD(pt)    \
   PT_YIELD_FLAG = 0;   \
   LC_SET(PT_STRUCT_ELEM(pt,lc));    \
   if(0 == PT_YIELD_FLAG){ return PT_YIELDED; }

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_YIELD_WHILE
// DESC: Yields the current thread while a supplied condition is true.Always
//       yeilds at least once.
// IN:   pt - protothread control structure
//       condition - condition that causes yielding
// OUT:NONE
// NOTE: Example:
//       int g_variable = 0;
//       pt_ret_t thread(pt_t &pt){
//          PT_BEGIN(pt);
//          PT_YIELD_UNTIL(0 != g_variable);
//          //do stuff here
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_YIELD_WHILE(pt, condition)\
   PT_YIELD_FLAG = 0;   \
   LC_SET(PT_STRUCT_ELEM(pt,lc));    \
   if((0 == PT_YIELD_FLAG) || (condition)){ return PT_YIELDED; }

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_YIELD_UNTIL
// DESC: Yields the current thread until a supplied condition becomes true.
//       Always yeilds at least once.
// IN:   pt - protothread control structure
//       condition - condition that ends yielding
// OUT:NONE
// NOTE: Example:
//       int g_variable = 0;
//       pt_ret_t thread(pt_t &pt){
//          PT_BEGIN(pt);
//          PT_YIELD_WHILE(0 != g_variable);
//          //do stuff here
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_YIELD_UNTIL(pt, condition)PT_YIELD_WHILE(pt, !(condition))

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_RESTART
// DESC: Restarts the current thread back to the beginning
// IN:   pt - protothread control structure
// OUT:NONE
// NOTE: Example:
//       BOOLEAN function();
//       pt_ret_t thread(pt_t &pt){
//          PT_BEGIN(pt);
//          if(!function()){
//             PT_RESTART(pt);
//          }
//          //do stuff
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_RESTART(pt)PT_INIT(pt); return PT_WAITING

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_EXIT
// DESC: Leaves the current thread with the PT_EXITED status
// IN:   pt - protothread control structure
// OUT:NONE
// NOTE: Example:
//       BOOLEAN function();
//       pt_ret_t thread(pt_t &pt){
//          PT_BEGIN(pt);
//          if(!function()){
//             PT_EXIT(pt);
//          }
//          //do stuff
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_EXIT(pt)   LC_SET(PT_STRUCT_ELEM(pt,lc)); return PT_EXITED

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_SCHEDULE
// DESC: Calls a thread from a non-thread function and compares it to
//       the current status.
// IN:   thread - protothread to call
// OUT:BOOLEAN - True if not PT_EXIT or PT_END
// NOTE: Example:
//       pt_ret_t thread(pt_t &pt);
//       void main(){
//          pt_t pt;
//          PT_INIT(pt);
//          while(PT_SCHEDULE(thread(pt)));
//          while(TRUE);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_SCHEDULE(thread) ((thread) < PT_EXITED)

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_WAIT_THREAD
// DESC: Calls a child thread from a protothread function and waits until
//       the child thread ends.Must call PT_INIT() on child prior to calling
//       thread.
// IN:   pt - parent protothread control structure
//       thread - protothread to call
// OUT:NONE
// NOTE: Example:
//       pt_ret_t childThread(pt_t &pt);
//       int g_variable = 0;
//       pt_ret_t thread(pt_t &pt){
//          pt_t child;
//          PT_BEGIN(pt);
//          PT_WAIT_UNTIL(0 != g_variable);
//          //do stuff here
//          PT_INIT(child);
//          PT_WAIT_THREAD(pt,childThread(child));
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_WAIT_THREAD(pt, thread)PT_WAIT_WHILE(pt,PT_SCHEDULE(thread))


///////////////////////////////////////////////////////////////////////////////
// NAME: PT_SPAWN
// DESC: Initializes a child thread context structure, calls the child
//       thread from a protothread function,and waits until the child thread
//       ends.
// IN:   pt - parent protothread control structure
//       child - child protothread control structure
//       thread - protothread to call
// OUT:NONE
// NOTE: Example:
//       pt_ret_t childThread(pt_t &pt);
//       int g_variable = 0;
//       pt_ret_t thread(pt_t &pt){
//          pt_t child;
//          PT_BEGIN(pt);
//          PT_WAIT_UNTIL(0 != g_variable);
//          //do stuff here
//          PT_SPAWN(pt,child,childThread(child));
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_SPAWN(pt, child, thread) PT_INIT(child); PT_WAIT_THREAD(pt,thread)


///////////////////////////////////////////////////////////////////////////////
//***************** Semiphore Interface *************************************//
///////////////////////////////////////////////////////////////////////////////

//Variable typedefs
typedef struct{
   unsigned int16 count;
} pt_sem_t;

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_SEM_INIT
// DESC: Initializes the a semiphore for a protothread.
// IN:   s - protothread semiphore structure
//       c - initial count
// OUT:NONE
// NOTE: Example:
//       pt_ret_t thread(pt_t &pt, pt_sem_t &sem);
//       void main(){
//          pt_t pt;
//          pt_sem_t sem;
//          PT_INIT(pt);
//          PT_SEM_INIT(sem,0);
//          while(TRUE){PT_SCHEDULE(thread(pt,sem));}
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_SEM_INIT(s, c) PT_STRUCT_ELEM(s,count) = c

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_SEM_WAIT
// DESC: Forces the current thread to block until the semiphore has a non
//       zero count.Decrements the count afterwards.
// IN:   pt - protothread control structure
//       s - protothread semiphore structure
// OUT:NONE
// NOTE: Example:
//       pt_ret_t thread(pt_t &pt, pt_sem_t &sem){
//          PT_BEGIN(pt);
//          PT_SEM_WAIT(pt,sem);
//          //consume something
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_SEM_WAIT(pt, s)            \
   PT_WAIT_UNTIL(pt, PT_STRUCT_ELEM(s,count) > 0);\
   --(PT_STRUCT_ELEM(s,count))

///////////////////////////////////////////////////////////////////////////////
// NAME: PT_SEM_SIGNAL
// DESC: Increments the semiphore count.
// IN:   pt - protothread control structure
//       s - protothread semiphore structure
// OUT:NONE
// NOTE: Example:
//       int g_variable = 0;
//       pt_ret_t thread(pt_t &pt, pt_sem_t &sem){
//          PT_BEGIN(pt);
//          while(0 == g_variable){
//             //produce some stuff
//          }
//          PT_SEM_SIGNAL(pt,sem);
//          PT_END(pt);
//       }
///////////////////////////////////////////////////////////////////////////////
#define PT_SEM_SIGNAL(pt, s)++(PT_STRUCT_ELEM(s,count))



/*
Copyright (c) 2004-2005, Swedish Institute of Computer Science.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the Institute nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS `AS IS' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

Author: Adam Dunkels
*/

#list
#endif

mathison 发表于 2018-8-12 17:47:54

pic_flash 发表于 2018-8-9 18:44
我个人没有用过, 但是有人移值到CCS C, 没有后续的跟进, 有没有问题不知道, 根据移植的作者说,CCS C ...

谢谢 pic_flash 。

我写的程序结构不好,改着改着就成了意大利面了。

lsy5110 发表于 2018-9-1 21:55:59

ccs是不是不需要MPLAB了,可以独立运行编辑?

1328616904 发表于 2018-9-1 23:48:04

pic_flash 发表于 2018-8-9 18:44
我个人没有用过, 但是有人移值到CCS C, 没有后续的跟进, 有没有问题不知道, 根据移植的作者说,CCS C ...

麻烦更新一下PCWHD_V5.080

pic_flash 发表于 2018-9-2 13:22:39

lsy5110 发表于 2018-9-1 21:55
ccs是不是不需要MPLAB了,可以独立运行编辑?

是的。。他有自己的IDE, 直接编译。
我没有用MPLAB, 除了需要使用PICKIT3 来烧录时,才用MPLAB IPE 做烧录而已 。

pic_flash 发表于 2018-9-2 15:02:45

1328616904 发表于 2018-9-1 23:48
麻烦更新一下PCWHD_V5.080

PIC 编译器, CCS C
版本: PCWHD_V5.080(PIC 编译器)
链接:https://pan.baidu.com/s/1mY3kjAyl-w4T1fYaG3SAMg
密码:y3bi


5.080A problem with memcpy() throwing an error under Linux is fixed
5.080A bug involving passing arrays to an inline function for some chips is fixed
5.080A problem with some fields with a indirect type inside a const struct throwing an error is fixed
5.080A linker error finding files when an output directory is used is fixed
5.080Fixed issue with assigning output pins with #pin_select and pin_select() function on some PCD devices
5.080A bug in make32 for PCD parts when assigned using an indirect address is fixed

lsy5110 发表于 2018-9-2 16:56:29

pic_flash 发表于 2018-9-2 13:22
是的。。他有自己的IDE, 直接编译。
我没有用MPLAB, 除了需要使用PICKIT3 来烧录时,才用MPLAB IPE 做 ...

谢谢,没用过PIC,有时间玩玩。

pic_flash 发表于 2018-9-2 19:22:29

lsy5110 发表于 2018-9-2 16:56
谢谢,没用过PIC,有时间玩玩。

PIC很贵, 所以比较少人用吧, 但是他的性能不错。

lsy5110 发表于 2018-9-2 19:55:51

pic_flash 发表于 2018-9-2 19:22
PIC很贵, 所以比较少人用吧, 但是他的性能不错。

pic kit2可以在线带电下载程序吗?

lsy5110 发表于 2018-9-2 20:11:44

pic_flash 发表于 2018-9-2 19:22
PIC很贵, 所以比较少人用吧, 但是他的性能不错。

以前都是弄51,AVR,AVR也很好用的。

pic_flash 发表于 2018-9-3 11:00:13

lsy5110 发表于 2018-9-2 19:55
pic kit2可以在线带电下载程序吗?

可以, ICSP, 你可以由PICKIT2供电, 或者你的板自上电。

但是注意,PICkit2不支持最新的PIC芯片, 我平时是用pickit2, 需要时才用pickit3.

pic_flash 发表于 2018-9-3 11:02:46

lsy5110 发表于 2018-9-2 20:11
以前都是弄51,AVR,AVR也很好用的。

有时你习惯了 就这样用下去吧 , 不需要改了。。因为每个人顺手顺心的芯片最好用。

korren 发表于 2018-9-3 11:21:17

pic_flash 发表于 2018-9-3 11:02
有时你习惯了 就这样用下去吧 , 不需要改了。。因为每个人顺手顺心的芯片最好用。 ...

楼主更新软件挺快的嘛,谢谢!

lsy5110 发表于 2018-9-3 19:41:08

pic_flash 发表于 2018-9-3 11:00
可以, ICSP, 你可以由PICKIT2供电, 或者你的板自上电。

但是注意,PICkit2不支持最新的PIC芯片, 我 ...

谢谢,业余爱好,没啥太多要求。

chenhu2012 发表于 2018-9-4 11:50:43

LZ威武!!!

1328616904 发表于 2018-9-11 13:54:33

pic_flash 发表于 2018-9-3 11:00
可以, ICSP, 你可以由PICKIT2供电, 或者你的板自上电。

但是注意,PICkit2不支持最新的PIC芯片, 我 ...

楼主请问怎么用CCS调试PIC的,还有如何调用ICD2调试,手上只有ICD2和PICkit3,但是测试发现都无法工作,以前一直都是用8点几版本调试pic,可惜老版本不支持新的mcu

pic_flash 发表于 2018-9-12 14:38:28

1328616904 发表于 2018-9-11 13:54
楼主请问怎么用CCS调试PIC的,还有如何调用ICD2调试,手上只有ICD2和PICkit3,但是测试发现都无法工作, ...

我没有用debugger
我是用Proteus 模拟调试的。

1328616904 发表于 2018-9-12 22:10:19

pic_flash 发表于 2018-9-12 14:38
我没有用debugger
我是用Proteus 模拟调试的。

有教程吗?如何操作

pic_flash 发表于 2018-9-12 22:23:28

1328616904 发表于 2018-9-12 22:10
有教程吗?如何操作

Proteus 本坛可以找到
教程网上搜一搜就有。。

1328616904 发表于 2018-9-17 18:24:11

本帖最后由 1328616904 于 2018-9-17 18:25 编辑

pic_flash 发表于 2018-9-12 22:23
Proteus 本坛可以找到
教程网上搜一搜就有。。

已经可以了,但是怎么仿真不支持浮点数显示,你的可以吗?还有默认创建的源码无法工作,必须用CCS编译器单独创建一个项目加载进去才行

pic_flash 发表于 2018-9-18 21:58:37

1328616904 发表于 2018-9-17 18:24
已经可以了,但是怎么仿真不支持浮点数显示,你的可以吗?还有默认创建的源码无法工作,必须用CCS编译器 ...

你是指debug value 显示不到float?是的 , 我的也不能显示。
尽量少用float, 耗内存的很。。

初次使用Proteus, 有没有被他惊艳到?

1328616904 发表于 2018-9-18 23:32:47

本帖最后由 1328616904 于 2018-9-18 23:34 编辑

pic_flash 发表于 2018-9-18 21:58
你是指debug value 显示不到float?是的 , 我的也不能显示。
尽量少用float, 耗内存的很。。



嗯,是的,不用float怎么计算电压范围,放大倍数吗?很多年前只用是protues跑程序,不知道可以调试,而且不能用int1定义变量,不认识的类型,是不是调试的时候不用这个,实际产品用这个操作

1328616904 发表于 2018-9-20 08:36:34

本帖最后由 1328616904 于 2018-9-20 08:37 编辑

pic_flash 发表于 2018-9-18 21:58
你是指debug value 显示不到float?是的 , 我的也不能显示。
尽量少用float, 耗内存的很。。



还发现一个问题,怎么计算小数位保留存在不对呀,我取消浮点数,放大一百倍,需要计算的时候用小数位运算才可以保留两位有效小数位,对于数据运算PIC CCS有啥特别吗

1328616904 发表于 2018-9-20 16:28:50

pic_flash 发表于 2018-9-18 21:58
你是指debug value 显示不到float?是的 , 我的也不能显示。
尽量少用float, 耗内存的很。。



为啥PIC12F1572 DAC无法输出3.3V

pic_flash 发表于 2018-9-22 17:51:55

1328616904 发表于 2018-9-20 08:36
还发现一个问题,怎么计算小数位保留存在不对呀,我取消浮点数,放大一百倍,需要计算的时候用小数位运算 ...

看看你的代码

1328616904 发表于 2018-9-22 21:32:31

本帖最后由 1328616904 于 2018-9-22 21:42 编辑

pic_flash 发表于 2018-9-22 17:51
看看你的代码

#include <12F1572.h>
#device ADC=10

#fuses INTRC_IO               //I/O function on OSC2
#fuses NOWDT                  //No Watch dog
#fuses NOPUT                  //No Power Up Timer
#fuses NOMCLR                   //Master Clear pin disabled
#fuses NOPROTECT                //Code not protected from reading
#fuses NOBROWNOUT               //No brownout reset
#fuses NOCLKOUT               //No clkout reset
#fuses NOWRT                  //Program memory not write protected
#fuses STVREN                   //Stack full/underflow will cause reset
#fuses BORV19                   //Brownout reset at 1.9V
#fuses NOLPBOR                  //Low-Power Brownout reset is disabled
#fuses NODEBUG                  //DEBUG is disabled
#fuses NOLVP                  //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O

#use delay(internal=16MHz)
#use FIXED_IO( A_outputs=PIN_A5 )
#define GP0_MOSOUT PIN_A5

void main()
{
        unsigned int16 ADCResult;
        unsigned int8 dac_value, dac_value_backup;

        setup_adc_ports(sAN1 | sAN2 | sAN3, VSS_VDD);
        setup_adc(ADC_CLOCK_INTERNAL);
        setup_dac(DAC_VDD | DAC_OUTPUT);
//   setup_vref(VREF_ON | VREF_COMP_DAC_4v096);
//   setup_dac(DAC_FVR | DAC_OUTPUT);

        setup_timer_0(RTCC_INTERNAL | RTCC_DIV_16 | RTCC_8_BIT); //1.0 ms overflow
        enable_interrupts(INT_TIMER0);
        enable_interrupts(GLOBAL);
      while(TRUE)
        {
                set_adc_channel(1);
                delay_us(20);
                ADCResult = read_adc();
                set_adc_channel(2);
                delay_us(20);
                ADCResult = read_adc();
                set_adc_channel(3);
                delay_us(20);
                ADCResult = read_adc();
                v6_voltage = (float)ADCResult * (5.0 / 1023);
                v5_voltage = (float)ADCResult * (5.0 / 1023);
                v3_voltage = (float)ADCResult * (5.0 / 1023);
               dac_value = 3.3 * 31 / 5.0;
              dac_write(dac_value);
}
当dac_value = 3.3 * 31 / 5.0;时 DAC输出只有2.36V,还有中断中判断v3_voltage<1.5的数据就会出现这个问题>>> Warning 216 "dc400w.c" Line 286(1,2): Interrupts disabled during call to prevent re-entrancy:(@FLT)
,不知道啥原因

pic_flash 发表于 2018-9-23 13:10:24

当dac_value = 3.3 * 31 / 5.0;时 DAC输出只有2.36V
你有驱动什么负载吗?

,还有中断中判断v3_voltage<1.5的数据就会出现这个问题>>> Warning 216 "dc400w.c" Line 286(1,2): Interrupts disabled during call to prevent re-entrancy:(@FLT)
,不知道啥原因
感觉是代码问题, 中断里面又呼叫中断

chenhu2012 发表于 2018-10-29 12:44:26

{:tongue:}来看看楼主。

chenhu2012 发表于 2018-12-18 23:32:23

{:handshake:}来看看楼主。

pic_flash 发表于 2018-12-24 17:24:07

PIC 编译器, CCS C
版本: PCWHD_V5.081(PIC 编译器)
链接:https://pan.baidu.com/s/1TOPnI4auDscWi26n4R5VVQ
密码:li8x

chenhu2012 发表于 2018-12-28 14:11:56

谢谢分享!!!

chenhu2012 发表于 2019-2-22 08:17:40

来看看楼主。

jojo_ou 发表于 2019-3-13 19:21:58

CCS新手请教!
请楼主和坛友帮个忙!
问题在代码中的中文注释里。
附上RS232调试图片。

#include <RS232.h>

void RS232_RX_EN();
void RS232_TX_EN();
void RS232_ON();

void main()
{
   char key_buffer;
   RS232_ON();
   while(TRUE)
   {
   RS232_TX_EN();
   cout<<"please press any key,and then enter!\r\n";
   delay_ms(2);
   RS232_RX_EN();
   cin>>key_buffer; //首次运行到这里,key_buffer里面多出一个空格,
                            //第二次开始就没有出现这个空格了。
                            //把cin换成gets(),也是一样!
   delay_ms(2);
   RS232_TX_EN();
   cout<<key_buffer<<"\r\n";
   delay_ms(2);
   }
}

pic_flash 发表于 2019-3-13 21:42:22

CCS C 一般不会这样写。。你的源码从那里转过来的?

#include <RS232.h>
void RS232_RX_EN();
void RS232_TX_EN();
void RS232_ON();
上面的源码没有放出, 看不到问题在那里。

jojo_ou 发表于 2019-3-14 00:34:39

这是使能485/232芯片模式和使能芯片发送/接收,
由于硬件设计上的问题,不能实现RS232双工模式。
上次说的问题关键在于,上电后,第一次cin就会多一个空格,
之后就没事了。如果断电后,再运行,也是第一次cin多出一个空格。
编译器是你上传的5.080版本。

void RS232_RX_EN()
{
      output_low(DEN);            //Tx is disenabled
      output_low(RXEN_L);       //Rx is enabled
      output_high(RXEN_H);   //Rx is enabled
      delay_ms(1);
}

void RS232_TX_EN()
{
      output_high(RXEN_L);       //Rx is disenabled
      output_low(RXEN_H);       //Rx is disenabled
      output_high(DEN);          //Tx is enabled
      delay_ms(1);
}


void RS232_ON()
{
      output_low(Select485_232);//RS232 mode
      output_high(ON);                //enables the charge pumps
}

pic_flash 发表于 2019-3-14 09:34:36

jojo_ou 发表于 2019-3-14 00:34
这是使能485/232芯片模式和使能芯片发送/接收,
由于硬件设计上的问题,不能实现RS232双工模式。
上次说的 ...

我没有用过 C++ 的语法在 CCS C 里, 你是第一个我看到的。。
<RS232.h>这个可以看看吗?

如果可以, 你上传完整的源码, 我可以用proteus 模拟测试

其实对于RS485 通信,CCS C 有很简单的方法。 因为你只是发部分源码, 我看不到你有没有使用。

jojo_ou 发表于 2019-3-14 20:44:45

仅仅是做简单的测试代码,不是工程文档。
附上测试代码原档。
另外再请教个关于在CCS IDE下如何使用PICKIT3对类似于DSPIC30F6014A有引导保护段功能进行调试和下载的问题。
目前可以在CCS IDE下使用PICKIT3对DSPIC33EP的进行调试和下载,但对DSPIC30F6014A不行。是否有这类资料推荐。
另外对于两款proteus好像没有库,该怎么弄。

pic_flash 发表于 2019-3-15 09:56:13

jojo_ou 发表于 2019-3-14 20:44
仅仅是做简单的测试代码,不是工程文档。
附上测试代码原档。
另外再请教个关于在CCS IDE下如何使用PICKIT3 ...

我只是猜测:
开始有空格, 很可能是你的ISL41387 上电后产生的一个乱码。。
   RS232_ON();
   RS232_RX_EN();
过后芯片稳定了。。但是dsPIC 也接收了1个byte
下面源码对Key_buffer 预设已知的/0
再清除USART_Port1的硬件缓存。
请试试看。。

void main()
{

   unsigned int8 x;
   char key_buffer;
   RS232_ON();
   RS232_RX_EN();

   for(x=0;x<20;x++)
   {
      key_buffer=0; //init key buffer
   }

   delay_ms(50);/ / 初始,让系统稳定
   while (kbhit(UART_PORT1))
   {
       x=fgetc(UART_PORT1); //把Port1 的buffer 先清除
   }
   
   while(TRUE)
   {
   RS232_TX_EN();
   fputs("please press any key,and then enter!",UART_PORT1);
   delay_ms(2);
   RS232_RX_EN();
   fgets(key_buffer,UART_PORT1); //首次运行到这里,key_buffer里面多出一个空格
                  //第二次开就没有出现了
   delay_ms(2);
   RS232_TX_EN();
   fputs(key_buffer,UART_PORT1);
   delay_ms(2);
   }

}

pic_flash 发表于 2019-3-15 10:42:45

另外再请教个关于在CCS IDE下如何使用PICKIT3对类似于DSPIC30F6014A有引导保护段功能进行调试和下载的问题。
目前可以在CCS IDE下使用PICKIT3对DSPIC33EP的进行调试和下载,但对DSPIC30F6014A不行。是否有这类资料推荐。

抱歉,这个我没有弄过。。可能以后你解决了可以和大家分享。

另外对于两款proteus好像没有库,该怎么弄。
没办法, 目前proteus里面dsPIC 的库很老旧的

如果我只是简单测试模拟, 我会找接脚相近的PIC24 来替代。。。

比如:


//#define Proteus
#ifdef Proteus
   #include <24FJ64GA006.h>
   #FUSES WDT, HS,PROTECT
   #use delay(internal=8MHz, clock=8MHz, restart_wdt)
   #use rs232(UART1, baud=19200, stream=UART_PORT1, ENABLE=pin_F6, errors)
#else
   // dsPIC
   #include <33FJ64GS606.h>
   #use delay(clock=100MHz,crystal=10MHz, restart_wdt)
   #FUSES HS, NOWDT, PROTECT, CKSFSM, NOJTAG
   #use rs232(UART1, baud=256000, stream=UART_PORT1, ENABLE=pin_F6, errors)
#EndIF


jojo_ou 发表于 2019-3-15 13:07:18

感谢楼主!
15.   while (kbhit(UART_PORT1))

16.   {

17.       x=fgetc(UART_PORT1); //把Port1 的buffer 先清除

18.   }

这一步解决了问题!

jojo_ou 发表于 2019-3-15 19:38:30

楼主:请问这个CCS编译器是不是不严谨?
void main()
{

unsigned int a;
unsigned int8 b;
unsigned int16 c;
unsigned int32 d;
a=-5;
b=-6;
c=-7;

d=a+b+c;
}
像上面的代码,无符号变量赋值负数,编译竟然无任何警告!
0 Errors,0 Warnings.

pic_flash 发表于 2019-3-16 14:38:48

jojo_ou 发表于 2019-3-15 19:38
楼主:请问这个CCS编译器是不是不严谨?
void main()
{


或许吧。。

jojo_ou 发表于 2019-3-21 19:56:17

pic_flash 发表于 2019-3-16 14:38
或许吧。。

楼主,有没有CCS编写的点阵LCD128*64的ST7565的串行SPI驱动和240*160的UT1698或ST7565的SPI驱动源码推荐下载?

szdy 发表于 2019-3-21 20:08:52

多年前用PIC单片机时就用CCS编译器,它容易上手但Bug多,现PIC价格贵,抗干扰不行,弃用好几年了

pic_flash 发表于 2019-3-24 15:22:01

jojo_ou 发表于 2019-3-21 19:56
楼主,有没有CCS编写的点阵LCD128*64的ST7565的串行SPI驱动和240*160的UT1698或ST7565的SPI驱动源码推荐 ...

在sample, driver 的文件夹理有。

pic_flash 发表于 2019-3-24 15:23:14

szdy 发表于 2019-3-21 20:08
多年前用PIC单片机时就用CCS编译器,它容易上手但Bug多,现PIC价格贵,抗干扰不行,弃用好几年了 ...

请问是哪个型号的PIC 抗干扰不行?

pcl 发表于 2019-3-24 18:38:52

PIC抗干扰是强项,怎么会不行?

jojo_ou 发表于 2019-3-26 22:02:03

楼主,有没有DSPIC33系列的CCS资料或书籍推荐

chenhu2012 发表于 2019-3-27 08:59:00

想楼主了,来看看{:titter:}{:titter:}{:titter:}

njhying 发表于 2019-3-27 09:10:39

本帖最后由 njhying 于 2019-3-27 09:13 编辑

szdy 发表于 2019-3-21 20:08
多年前用PIC单片机时就用CCS编译器,它容易上手但Bug多,现PIC价格贵,抗干扰不行,弃用好几年了 ...

刚入门的可以理解,老鸟说抗干扰不行,是不是已经转做管理了?
现在国产芯片响声震天,可是芯片垃圾的和新能源车一样一样的,重新回归国外芯片。

jojo_ou 发表于 2019-3-30 17:12:50

njhying 发表于 2019-3-27 09:10
刚入门的可以理解,老鸟说抗干扰不行,是不是已经转做管理了?
现在国产芯片响声震天,可是芯片垃圾的和 ...

楼主,CCS有没有自带的LCD GUI?求推荐

sweet_136 发表于 2019-3-30 23:11:54

楼主, 我发现Pic写EEPROM 经常有数据没保存的情况。。
w'rite——eeprom

pic_flash 发表于 2019-4-2 15:04:51

sweet_136 发表于 2019-3-30 23:11
楼主, 我发现Pic写EEPROM 经常有数据没保存的情况。。
w'rite——eeprom

我没有碰过这种问题,但是你可以试验看看:
在 write_eeprom 之前, 加入 interrupt_global (disable);关闭中断, 写好后再开回中断。

看看是不是中断引起写入失败。

pic_flash 发表于 2019-4-2 15:11:30

jojo_ou 发表于 2019-3-30 17:12
楼主,CCS有没有自带的LCD GUI?求推荐

没有自带的。。可以自己找第三方的然后移值过去。
我知道Microchip 官方是有, 好像是给PIC32 的

目前 , 我开始使用 HMI USART 模块了, 省事很多。。而且非常强大。

sweet_136 发表于 2019-4-2 23:03:23

pic_flash 发表于 2019-4-2 15:11
没有自带的。。可以自己找第三方的然后移值过去。
我知道Microchip 官方是有, 好像是给PIC32 的



那是PIC CCS里面的模块吗?

pic_flash 发表于 2019-4-4 10:28:26

sweet_136 发表于 2019-4-2 23:03
那是PIC CCS里面的模块吗?

不是的。。。。。

jojo_ou 发表于 2019-4-14 15:41:29

pic_flash 发表于 2019-4-4 10:28
不是的。。。。。

楼主,是否有关于gfx_graphics.c gfx_graphics.h的说明或相关的学习资料介绍?

pic_flash 发表于 2019-4-18 11:05:17

jojo_ou 发表于 2019-4-14 15:41
楼主,是否有关于gfx_graphics.c gfx_graphics.h的说明或相关的学习资料介绍?

我没有。。如果你找到了, 可以分享一下

jojo_ou 发表于 2019-4-21 23:52:20

pic_flash 发表于 2019-4-18 11:05
我没有。。如果你找到了, 可以分享一下

楼主,帮我看看我的工程编译时,为什么结构体成员会出错,跪谢。

jojo_ou 发表于 2019-4-22 22:50:20

楼主,在线等。QQ我,46125279

pic_flash 发表于 2019-4-23 09:14:20

jojo_ou 发表于 2019-4-21 23:52
楼主,帮我看看我的工程编译时,为什么结构体成员会出错,跪谢。


编译了, 没有看到什么报错。。

pic_flash 发表于 2019-4-23 09:17:41



Did you hear the news? The CCS C Compiler now supports the dsPIC33CH family of devices! The dsPIC33CH family are the first dual core PICs available from Microchip, which allows the user to run two independent programs on the same device!
Keep an eye out for news stories on our website about the new features!

CCS 宣布他家的编译器已支持双核的dsPIC33CH !

jojo_ou 发表于 2019-4-23 11:05:11

pic_flash 发表于 2019-4-23 09:14
编译了, 没有看到什么报错。。

在BSP_key.c里的结构体调用时有提示。理论上应该没问题,我是完全移植STM32的过来的。

jojo_ou 发表于 2019-4-25 20:55:27

jojo_ou 发表于 2019-4-23 11:05
在BSP_key.c里的结构体调用时有提示。理论上应该没问题,我是完全移植STM32的过来的。
...

楼主,为什么我编译的出这种提示呢?

pic_flash 发表于 2019-4-26 15:18:56

jojo_ou 发表于 2019-4-25 20:55
楼主,为什么我编译的出这种提示呢?

不知道。。不过请注意, CCS C 不支持指针 pointer。

jojo_ou 发表于 2019-5-19 17:09:55

pic_flash 发表于 2019-4-26 15:18
不知道。。不过请注意, CCS C 不支持指针 pointer。

群主,可以上传最新版的CCS了,在线等。。。。

pic_flash 发表于 2019-5-19 17:57:46

jojo_ou 发表于 2019-5-19 17:09
群主,可以上传最新版的CCS了,在线等。。。。

最新是 5.085 , 但我没有。。。
努力上传5.083中。。云盘很慢

korren 发表于 2019-5-19 20:44:14

pic_flash 发表于 2019-5-19 17:57
最新是 5.085 , 但我没有。。。
努力上传5.083中。。云盘很慢

非常感谢楼主更新!

pic_flash 发表于 2019-5-19 20:58:16

PIC 编译器, CCS C
版本: PCWHD_V5.083(PIC 编译器)
链接:https://pan.baidu.com/s/1FsdVZzI_EbDxFTrT0HBOmA
提取码:8npq

jojo_ou 发表于 2019-5-20 09:22:00

pic_flash 发表于 2019-5-19 20:58
PIC 编译器, CCS C
版本: PCWHD_V5.083(PIC 编译器)
链接:https://pan.baidu.com/s/1FsdVZzI_EbDxFTr ...

楼主,请问有没有关于CCS自带MODBUS.C使用方法和说明的资料推荐?

jojo_ou 发表于 2019-5-20 11:35:53

pic_flash 发表于 2019-5-19 20:58
PIC 编译器, CCS C
版本: PCWHD_V5.083(PIC 编译器)
链接:https://pan.baidu.com/s/1FsdVZzI_EbDxFTr ...

楼主,请教一下,在led.h中声明led.c中的函数,然后#include <led.h>,在main中调用led.h中声明的函数,编译不能通过。
如果用#include <led.c>,刚可以通过。请问这是啥原因
编译出错提示:
Compiling E:\hex\test_ccs\test\test1\main on 20-五月-19 at 11:33
*** Error 112 "E:\hex\test_ccs\test\test1\main.c" Line 10(1,1): Function used but not defined:... led_flash 1453SCR=1949
      1 Errors,0 Warnings.
Build Failed.
源文件如下:
/////////////////////////////////////
《main.c文件》
#include <main.h>
#include <led.h>
void main()
{
   //Example blinking LED program
   while(true)
   {
led_flash();
   }
}
/////////////////////////////////////
《main.h文件》
#include <33EP512MU814.h>
#device ICSP=1
#use delay(clock=140MHz,crystal=20MHz)
#FUSES NOWDT                  //No Watch Dog Timer
#FUSES CKSFSM                   //Clock Switching is enabled, fail Safe clock monitor is enabled
#define LED PIN_B2
#define DELAY 1000
/////////////////////////////////////
《led.c文件》
#include <led.h>
void led_flash()
   {
      output_low(LED);
      delay_ms(DELAY);
      output_high(LED);
      delay_ms(DELAY);
   }
/////////////////////////////////////
《led.h文件》
#ifndef _LED_H_
#define _LED_H_
extern void led_flash();
#endif

pic_flash 发表于 2019-5-20 12:25:31

试试:

/////////////////////////////////////
《main.c文件》
#include <main.h>
#include <led.h>
#include <led.c>
void main()
{
   //Example blinking LED program
   while(true)
   {
led_flash();
   }
}

pic_flash 发表于 2019-5-20 12:26:52

jojo_ou 发表于 2019-5-20 09:22
楼主,请问有没有关于CCS自带MODBUS.C使用方法和说明的资料推荐?

没有哦。。。

jojo_ou 发表于 2019-6-3 22:11:44

pic_flash 发表于 2019-5-20 12:26
没有哦。。。

群主,请教一下CCS C在条件编译时,没有被编译的能不能改变他颜色?

pic_flash 发表于 2019-6-4 08:48:46

jojo_ou 发表于 2019-6-3 22:11
群主,请教一下CCS C在条件编译时,没有被编译的能不能改变他颜色?

这个难倒我了, 我都是用默认的颜色, 没有去改过。
好像上面你那种, 我一般会按 【-】把他们“收”起来不看呢。。

jojo_ou 发表于 2019-6-4 16:43:49

pic_flash 发表于 2019-6-4 08:48
这个难倒我了, 我都是用默认的颜色, 没有去改过。
好像上面你那种, 我一般会按 【-】把他们“收”起来 ...

群主,帮研究研究,如果能改颜色的话,以后可以一劳永逸了!
等回复哦

jojo_ou 发表于 2019-7-10 16:38:51

pic_flash 发表于 2019-5-19 20:58
PIC 编译器, CCS C
版本: PCWHD_V5.083(PIC 编译器)
链接:https://pan.baidu.com/s/1FsdVZzI_EbDxFTr ...

群主,帮忙找一下MODBUS CCS实例

pic_flash 发表于 2019-7-11 09:41:25

jojo_ou 发表于 2019-7-10 16:38
群主,帮忙找一下MODBUS CCS实例

C:\Program Files (x86)\PICC\Examples\ex_modbus_master.c
C:\Program Files (x86)\PICC\Examples\ex_modbus_slave.c

chenhu2012 发表于 2019-8-7 08:36:33

{:handshake:}

喜欢雪的人 发表于 2019-8-9 15:12:12

CCS可以和iar配合使用吗

pic_flash 发表于 2019-8-10 10:00:37

喜欢雪的人 发表于 2019-8-9 15:12
CCS可以和iar配合使用吗

应该不能。
页: 1 2 3 [4] 5
查看完整版本: 【交流】CCS C PIC 编译器的同好请来交流