完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我现在正在研究一个项目,在阅读RFID UID卡。我正在使用ECEL技术公司的CHILLIU-UART-B1模块,而我正努力与通信协议相抗衡。看起来我必须发送一个字节的数据包给模块,但是我不太确定如何继续。下面是我的PIC16F1619的数据表:模块的数据表:我不能把链接放在这里,你可以在ECCEL技术网站RFID模块上找到数据表,称为RFID B1和它的用户手册。这是我的代码:有些评论是法语的,如果需要的话我可以翻译,谢谢你的回答。
以上来自于百度翻译 以下为原文 Hello everyone, I am currently working on a project that concist in reading rfid UID cards. I'm using the Chilli-UART-b1 module from Eccel technologie and i'm struggling with the communication protocole. It seems like i have to send packets of bytes to the module but i'm not really sure on how to proceed. Here is the datasheet of my PIC16f1619 : The datasheet of the module : i can't put link in here, you can find the datasheet on eccel technology website rfid module called RFID B1 and its user manual : Here is my code : Some of the comments are in French i can translate if necessary /* * File: main.c * Author: Pierre */ // CONFIG1 #pragma config FOSC = INTOSC // Oscillator Selection Bits (ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins) #pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled) #pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR) #pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) #pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled) #pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin) #pragma config IESO = ON // Internal/External Switch Over (Internal External Switch Over mode is enabled) #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled) // CONFIG2 #pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off) #pragma config PPS1WAY = ON // Peripheral Pin Select one-way control (The PPSLOCK bit cannot be cleared once it is set by software) #pragma config ZCD = OFF // Zero Cross Detect Disable Bit (ZCD disable. ZCD can be enabled by setting the ZCDSEN bit of ZCDCON) #pragma config PLLEN = ON // PLL Enable Bit (4x PLL is always enabled) #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset) #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.) #pragma config LPBOR = OFF // Low-Power Brown Out Reset (Low-Power BOR is disabled) #pragma config LVP = ON // Low-Voltage Programming Enable (Low-voltage programming enabled) // CONFIG3 #pragma config WDTCPS = WDTCPS1F// WDT Period Select (Software Control (WDTPS)) #pragma config WDTE = ON // Watchdog Timer Enable (WDT enabled) #pragma config WDTCWS = WDTCWSSW// WDT Window Select (Software WDT window size control (WDTWS bits)) #pragma config WDTCCS = SWC // WDT Input Clock Selector (Software control, controlled by WDTCS bits) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include #include #include #include #define _XTAL_FREQ 32000000 int n = 0; init (void){ TRISA = 0x01; //port A en mode sortie OSCCONbits.SCS = 0b00; OSCCONbits.IRCF = 0b1111; OSCCONbits.SPLLEN = 0b1; TMR0CS = 0;//horloge du système (FOSC/4) TMR0IE = 1; //autorise l'intteruption GIE = 1; //autorise interuption globale PEIE = 1; //autorise l'interruption des periphériques PSA = 1;//Pas de prescaler INTEDG = 1;//interruption sur le front montant de l'horloge } void init_UART(void){ RB7PPS = 0x012; ANSELBbits.ANSB5 = 0; TRISB7 = 0; //TX RC6 en mode sortie TRISB5 = 1; //RX RB5 en mode entrée RCIE = 1; SP1BRGL = 51; SP1BRGH = 51; BRGH = 0; BRG16 = 0; TX9 = 0; SYNC = 0; SPEN = 1; RX9 = 0; CREN = 1; TXEN = 1; } void send_char_UART(unsigned char c){ while(TXIF == 0); TX1REG = c; } unsigned char read_char_UART(){ while(RCIF); return RC1REG; } //void interrupt it(void){ // if(TMR0IF == 1){ // if(n>400){ // RA5 = !RA5; // n = 0; // }else{ // n++; // } // } // TMR0IF = 0; //} void main() { init(); init_UART(); while(1){ send_char_UART(0x00); if(read_char_UART() == 0x00){ RA2 = 1; }else{ RA2 = 0; } } } Thanks in advance for your answers |
|
相关推荐
7个回答
|
|
在微芯片花了这么长时间才批准它的时候,你就可以把你的话题推回到顶峰。
以上来自于百度翻译 以下为原文 Just posting to bump your topic back to the top, after Microchip took so long to approve it. |
|
|
|
您好,我建议您使用MCC插件来安装PIC16F1619。在MCC中已经准备好了用于UART和所有外围设备的库,因为这个设备(PIC16F1619)在好奇心板上使用,因此也有许多示例和应用说明;=好奇板有一个点击板SoCKE。T接受来自MikrelekTroNoKa的许多点击板,其中一些点击板也是使用UART的模块,因此这些将是一个很好的起点。好奇板:http://www. McCHIP.COM/DeaveDeavss/De164137http://www. MyCHIP.COM/MPLAB/MPLAB-CODEF-CONFIGuralor在当前下载选项卡,您可以找到Mikroelektronika点击。按照发行说明安装它(OU还需要安装PIC10/PIC12/PIC16/PIC18 MCU MCC库)。
以上来自于百度翻译 以下为原文 Hi, I suggest you use MCC plugin to setup the PIC16F1619. There are ready made libraries in MCC for UART and all the peripherals because this device ( PIC16F1619) is used on the curiosity board and therefore there are also many examples and application notes ;=) curiosity board has a click board socket which accept lots of click boards from Mikroelektronika and some of these clicks boards are modules which also use UART so these would be a very good starting point. curiosity board : https://www.microchip.com/DevelopmentTools/ProductDetails/DM164137 https://www.microchip.com/mplab/mplab-code-configurator under the current download tab you can find Mikroelektronika click. Follow the release notes to install it (ou will also need to install the PIC10 / PIC12 / PIC16 / PIC18 MCUs MCC libraries. Regards |
|
|
|
嗨,谢谢你的回答!我知道MikROE点击模块,我已经买了一个,但我没有找到任何RFID读卡器模块,可以读取MIFARE DISRAID UID。来自ECCCAN的一个。我看过一些关于MCC的教程,但是作为一个工科学生,我想制作我自己的代码,我不想依赖其他我不懂的库。今天我设法通过我的TX引脚发送了UART字节。我用我的示波器检查过了,效果不错。我现在面临的问题是,我不太确定如何与天线进行通信。唉,我不能直接把天线数据表的链接,但正如我在我的帖子早些时候说,它可以在ECCEL技术网站(RFID B1)找到。最好的问候
以上来自于百度翻译 以下为原文 Hi, Thank you for your answer ! I know mikroe clicks modules, i already bought one but i did not find any RFID reader module that could read Mifare Desfire UID. The one from Eccel can. I've seen some tutorial about MCC but as a engineering student i'd like to make my own code i don't want to rely on others libraries that i don't understand. Today i managed to send UART byte through my TX pin. I've checked with my oscilloscope and it worked. The problem i am facing now is that i'm not quite sure on how to communicate with this antenna. Alas i cannot directly put the link of the antenna datasheet but as i've said in my post earlier it can be found on Eccel technology website (RFID B1). Best regards |
|
|
|
在这里,您GoHThttp://ECCE.COUL.UART-B1-Reals/http://ECel.CO.UK/Optudit/CHILLI-UART-B1/HTTPS://ECel.CO.UK/WP-内容/下载/ UART-B1-USER手册。
以上来自于百度翻译 以下为原文 Here you go https://eccel.co.uk/chilli-uart-b1-reader/ https://eccel.co.uk/product/chilli-uart-b1/ https://eccel.co.uk/wp-content/downloads/UART-B1-User-manual.pdf |
|
|
|
|
|
|
|
你的帖子奇怪地空白了。你删除了吗?我在电子邮件通知中看到了原始文本:“波特”意思是“每秒比特”(不是原来的,但现在开始了)。没有所谓的“每秒波特率”。同样,正常的异步串行需要十位来发送一个字符,所以你的计算出了十倍。
以上来自于百度翻译 以下为原文 Your post has gone strangely blank. Did you delete it? I saw the original text in an email notification: "Baud" means "bits per second" (not originally, but it does now). There's no such thing as "bauds per second". Also, normal asynch serial takes TEN bits to send one character, so your calculations are out by a factor of ten. |
|
|
|
现在我看到你在HTTPS://www. McCHIP.COM/FUMUS/M1062490.ASPX中问了这个问题,在那里你得到了大致相同的答案。
以上来自于百度翻译 以下为原文 I now see you you re-asked this question at https://www.microchip.com/forums/m1062490.aspx where you received substantially the same answer. |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
729浏览 1评论
613浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
503浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
628浏览 0评论
526浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 13:21 , Processed in 1.360317 second(s), Total 91, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号