完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好下午好谢谢阅读我的问题!我有一个PIC18F13K50,我试着和LCD显示器通信,这个显示器有从地址0x28,所以我试着用我的图片和这个显示器通信,我不能这样做,也许我的代码有问题?我使用MPLAB XC8编译器v1.37,我应用5v到我的图片和显示器。我尝试发送0x31到我的显示器,我使用其他设备与显示器通信,显示器有很好的功能。如果任何人能帮助我,我添加一个附件与我的源代码,告诉我什么是wrong或任何想法,我会很感激你的。我两三天前就试着去做,但是没有成功:“(非常感谢你的时间。)
以上来自于百度翻译 以下为原文 Hello Good Afternoon thanks for read my problem!! I have a PIC18F13K50 I try to communicate with a LCD Display, this display have the Slave Address 0x28 so I try communicate with this display using my pic and I can't do that maybe is something wrong with my code?? I'm using MPLAB XC8 Compiler v1.37 and im applying 5v to my pic and the Display. I'm trying send a 0x31 to my display, i used others device to communicate with the display and the display have a good functionality. I add a attachment with my source code if any one can help me and say me what is wrong or any idea I would be grateful with you. I'm trying to do it 2 or 3 days ago and I haven't successful :'( Thank you very much for your time. Attachment(s) PIC18F13K50 i2c.txt (1.83 KB) - downloaded 37 times |
|
相关推荐
6个回答
|
|
你好,谢谢!!!!嗯,是的,这里是手册的链接,我在http之间放了空格,因为微芯片论坛不允许使用URL,我知道我的LCD的从地址是0x50,但是我用代码来做,但是LCD没有回复我……谢谢你的帮助!!!!
以上来自于百度翻译 以下为原文 Hello WB thanks for response!!! Amm yeah here is the link of the manual I put spaces between the http because The forum of Microchip don't give permission to use URL's I know what the Slave address of my LCD is 0x50 but i use the code to do that but the LCD not respond me .. Thanks for help !!! |
|
|
|
你好,谢谢!!!!嗯,是的,这里是手册的链接,我在http之间放了空格,因为微芯片论坛不允许使用URL,我知道我的LCD的从地址是0x50,但是我用代码来做,但是LCD没有回复我……谢谢你的帮助!!!!
以上来自于百度翻译 以下为原文 Hello WB thanks for response!!! Amm yeah here is the link of the manual I put spaces between the http because The forum of Microchip don't give permission to use URL's I know what the Slave address of my LCD is 0x50 but i use the code to do that but the LCD not respond me .. Thanks for help !!! |
|
|
|
你好,WB早上好!谢谢你的支持!哇!代码太多了!!!!但是非常感谢你们的支持!这个程序功能很好,对我的LCD我有学习的代码,学习一下这个函数!我很感激你!非常感谢!!
以上来自于百度翻译 以下为原文 Hello WB Good morning !! Thanks for your support !! WOW it's a lot code!!!! But thanks so much for your support!! This program Function very well on my LCD I have to study the code to learn how function this!! I'm Grateful with you !! Thank you very much !! |
|
|
|
谢谢N.Sn抱歉,这是我的最后一个问题,我看到代码只与“字符串”或字符,如果我想发送。举例来说,这是一个字节,我看到你使用“UIT88T”这是一个类似的字节正确吗?代码中的这部分用于发送所有Stringi2c_status_t i2c_Write(uint8_t命令、uint8_t*data、uint8_t len)这是发送所有uint8_t i2c_status_t i2c_Write8(uint8_t out_byte)的真正部分,我如何能够仅向LCD发送十六进制字符?我试图修改这个但是不能用十六进制字符。很抱歉,我是从1个月前开始在这个世界上的PicMec的,所以我没什么损失。我再次感谢你的帮助!!
以上来自于百度翻译 以下为原文 Thanks n__n Sorry its my last question, I see that the code is worked only with "string" or char, If i want send.. for example C000020001023A This are type byte i see that you use " uint8_t " this is similar a byte right? this part in your code is used to send all String i2c_status_t i2c_Write(uint8_t command, uint8_t *data, uint8_t len) well this is the real part to send the all uint8_t i2c_status_t i2c_Write8(uint8_t out_byte) how i can send only Hexadecimal characters to the LCD? I try to modify this but dont work with hexadecimal characters. Im sorry im starting in the world Pic meybe 1 mont ago, so i'm little lose.. And i repeat thanks for your help !! |
|
|
|
I2CX写例程服务于一个以上的目的。它用于两个控制命令,例如清除屏幕或设置光标位置,[edit:以及发送显示数据]。i2c_Write例程采用的三个参数是command(控制命令字节)、*data(指向包含命令数据的字节数组的指针)和len(从数组发送的字节数)。命令前面有命令前缀字符0xFE。用于显示的字符不是命令,因此它们前面没有任何字符。如果命令参数为零,则I2CX写入例程不向LCD发送命令前缀或命令字节。i2c_Write例程将0x00的命令识别为不发送命令,因此它只发送数据。有两种方法可以解释这个:“C000020001023A”。如果它是十六进制字节,那么您可以像这样构建数组:uint8_t MyData[]={0xC0,0x00,0x02,0x00,0x01,0x02,0x3A};数组中有7个字节,因此设置为tHel-Lead参数为7。变量MyDATA是指向数组的指针。MyDATA(0)或*MyDATA是数组中的第一个元素。字节基本上是无符号字符类型。这和uint8_t是一样的。我喜欢使用uint8_t,因为当您使用“stdint.h”头文件时,它是一个标准的C符号,并且它清楚地定义了位数。如果所有这些对于您来说都很奇怪,那么我建议您找一本关于C语言的好书,学习它,并练习。你会有更好的经验。
以上来自于百度翻译 以下为原文 The i2c_Write routine serves more than one purpose. It is used for both the control commands, such as clearing the screen or setting the cursor position,[edit: and for sending display data]. Some commands have data and some don't. The three parameters that the i2c_Write routine takes are command (the control command byte ), *data (a pointer to an array of bytes containing the command data), and len (the number of bytes to send from the array). Commands are preceded by by the command prefix character 0xFE. Characters for display are not commands so they are not preceded by anything. If the command parameter is zero then the i2c_Write routine does not send the command prefix or command byte to the LCD. The i2c_Write routine recognizes a command of 0x00 as no command so it sends only the data. There are two ways to interpret this: "C000020001023A". If it is hex bytes then you can build the array like this: uint8_t MyData[] = {0xC0,0x00,0x02,0x00,0x01,0x02,0x3A}; There are 7 bytes in the array so set the len parameter to 7. The variable MyData is a pointer to the array. MyData[0] or *MyData is the first element in the array. Bytes are essentially unsigned char types. That's the same as uint8_t. I like using uint8_t because it is a standard C notation when you use the "stdint.h" header file and it clearly defines the number of bits. If all this is strange to you then I suggest getting a good book on the C language, study it, and practice. You will get better with experience. |
|
|
|
你好!早上好!是的,你是对的,我不知道MeNurral: [-]是怎么回事,但是我是这样做的,非常感谢你的帮助。你帮了我那么多,祝你好运。
以上来自于百度翻译 以下为原文 Hello WB!! Good Morning! Yeah you have right, I don't know whats happen with me neutral: [:-] But yeah I do that, thanks so much for your help.... You help me so much. I wish you the best n__n |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3209 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2260 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
682浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 00:33 , Processed in 1.591888 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号