完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
您好,我正在研究16×2 LCD字符(字符大小8mm×5mm约)与DSPIC33 EP32 MC202。在LCD上的引脚对准是第一针15,第二引脚比从(第三针)1到(最后引脚)14. 15 LED + 16 LED -1 GND2 VCCC对比度4 RS5 RW6 EN-14和LT;D0 D14和Gt;LCD工作在4位模式下。第二行甚至不显示单个字符。(LCD单独工作(从其他设置检查))对于第二行LCD JHD162G M7的任何特殊地址。因为同一代码在JHD162A与0x28的4位设置上工作良好。——卡兰
以上来自于百度翻译 以下为原文 Hello, I am working on 16 x 2 LCD character for ( Character Size 8mm x 5mm approx) with dsPIC33EP32MC202.Pin Alignment on LCD is First Pin is 15, Second Pin is 16 than from (3rd Pin) 1 to (Last Pin) 14 . 15 LED+ 16 LED- 1 Gnd 2 VCC 3 Contrast 4 RS 5 RW 6 EN 7-14 #define LCD_STROBE (LCD_EN=1); __delay_us(10); (LCD_EN=0) ; void InitLCD()
LCDCommand(0x40); // Set 4 bit mode (Change from 0x28 from M7) // In Main LCDCommand(0x80); LCDCommand(0xC0); The LCD is working Fine in 4-bit First Line Only . Second Line is Not Even Show Single Character. (LCD alone is Working[Checked from Other Setup]) Any Special address for second line for LCD JHD162G M7 .?? |
|
相关推荐
19个回答
|
|
|
解释一下为什么你要发送40而不是28。
以上来自于百度翻译 以下为原文 Explain about this line LCDCommand(0x40); // Set 4 bit mode (Change from 0x28 from M7) why you are sending 40 rather than 28. |
|
|
|
|
|
与0x28液晶显示器不工作…有时数据显示有一段时间,有的时候没有显示在LCD上。
以上来自于百度翻译 以下为原文 With 0x28 LCD Not working... Sometimes Data display for Sometime, Some time Nothing displayed on LCD. |
|
|
|
|
|
这是命令,告诉显示器你使用4位模式,它有两条线。假设你的4个数据引脚都开始低,那么你选择了0x30三次,然后0x20一次。第一个三迫使它进入8位模式(通过发送0x30多次)M然后0x20交换机。它返回到4位模式。下一个命令应该设置N位和F位。你需要N=1来得到两行,但是你从来没有这样做,因为你删除了写0x28。这意味着你永远无法启用两行模式。发送0x40只是将地址指针设置为CGRAM,这是毫无意义的。
以上来自于百度翻译 以下为原文 That is the command that tells the display you are using 4 bit mode, and that it has two lines. Assuming your 4 data pins all start low, then you are strobing out 0x30 three times, then 0x20 once. The first three are forcing it into 8 bit mode (by sending 0x30 multiple times)m then the 0x20 switches it back to 4-bit mode. The next command should set the N and F bits. You need N=1 to get two lines, but you are never doing that because you removed writing the 0x28. That means you are never enabling two line mode. Sending 0x40 instead just sets the address pointer to CGRAM, which is pointless |
|
|
|
|
|
意味着我必须发送以下序列:是/否?
以上来自于百度翻译 以下为原文 Means I have to sent below sequence : LCD_BIT_D4=0; LCD_BIT_D5=0; LCD_BIT_D6=0; LCD_BIT_D7=0; LCDCommand(0x30); LCDCommand(0x30); LCDCommand(0x30); LCDCommand(0x20); LCDCommand(0x28); LCDCommand(0x0C); LCDCommand(0x01); LCDCommand(0x06); LCDCommand(0x80); Yes/No? |
|
|
|
|
|
不!您没有发布代码用于LCDMug(),但大概是在做4位的分裂,也许在等待BF标志。在init阶段,你不能使用这个命令。你的当前代码做的是正确的事情,除了你应该发送0x28,而不是0x40。
以上来自于百度翻译 以下为原文 No! You have not posted the code for LCDCommand(), but presumably it is doing the 4 bit splitting, and maybe waiting for the BF flag. You must NOT use that command during the init phase. Your current code was doing the correct things, EXCEPT you should be sending the 0x28, not 0x40. |
|
|
|
|
|
谢谢。。。更新..我不使用BF旗..好…如何在init LCD阶段发送数据?好的…请检查附件的代码,然后更新…-卡兰
以上来自于百度翻译 以下为原文 Thanks... for update.. I am not using BF Flag.. OK.. How to send data in Init LCD Phase.? Ok.. Please Check attachment for code and then update.. -- Karan Attachment(s) LCD_4_bit.c.txt (2.24 KB) - downloaded 65 times |
|
|
|
|
|
正如我所说,这个代码做了所有正确的事情,除了发送0x40,你应该发送0x28。为什么选择0x40?我会把它换成0x28,然后从那里开始工作。
以上来自于百度翻译 以下为原文 As I said, that code is doing all the correct things, EXCEPT for sending 0x40 where you should be sending 0x28. Why pick 0x40? I would change it back to 0x28, and work from there. |
|
|
|
|
|
再次感谢,请检查附件..这是什么意思?我应该选择哪些功能?正如我前面所说的0x28 LCD JHD162G M7不工作,BUJHD162A工作正常。
以上来自于百度翻译 以下为原文 Thanks again Please Check attachment.. What is the meaning of this ? Which function I should chose ? As I said earlier 0x28 LCD JHD162G M7 I not working , but JHD162A is working fine . Attachment(s) LCD_4_bit.c.txt (2.24 KB) - downloaded 38 times |
|
|
|
|
|
这是什么意思?在POST后5中,您显示了一些替代代码,通过LCDMug()函数发送init命令。我是说不要这样做。继续按照原始代码执行它,这是正确的方法。我已经在POST第6版中说了这一切。
以上来自于百度翻译 以下为原文 What is the meaning of this ? In post#5 you showed some alternative code sending the init commands via your LCDCommand() function. I was saying DON'T DO THAT. Keep doing it the way your original code does it, which is the correct way. I already said all this in post#6. |
|
|
|
|
|
BTLCDJHD162G M7不在MSG的代码中工作,我该怎么办?
以上来自于百度翻译 以下为原文 But LCD JHD162G M7 is not working the code attached in Msg #10. What do I do ? |
|
|
|
|
|
好的,试试这个。在这里直接添加这个额外的代码之后,将第一个调用删除到LCDCug()(即发送0x40或0x28)。
以上来自于百度翻译 以下为原文 ok, try this. Where you have LCD_BIT_D4 = 0; LCD_STROBE ; __delay_ms(1); add this extra code straight after. LCD_BIT_D6 = 1; LCD_BIT_D7 = 1; // dat = 1110xxxx, N=1, F=1 (4&5 are don't care) LCD_STROBE ; __delay_ms(1); and delete the first call to LCDCommand() (that was sending 0x40 or 0x28) |
|
|
|
|
|
因为这个愚蠢的论坛,我需要几次完全的发布。一般来说,当同一个LCD例程为一个LCD工作,而不是另一个LCD时,它通常是一个定时问题。也就是说,你的代码没有等待每个命令的执行时间,因为它没有使用繁忙的检查。除了清晰的显示和光标HOLD,LCD操作大约需要40个,最多可以占用1.64毫秒,因此,取代了LC-C-CONVALTE()中的最后一个延迟。???看起来这个函数名被禁止了吗????用Qub替换,然后发送0x28而不是0x40。
以上来自于百度翻译 以下为原文 Because of this stupid forum, it will take me a few times to completely post this. In general, when the same LCD routines work for one LCD but not another, it is usually a timing problem. That said, your code is not waiting the execution time of each command since it is not using the BUSY check. Most LCD operations take about 40 us except for Clear Display and Cursor Home which can take up to 1.64 ms. So, replace the last delay in L-C-D-Con-vert() ??? it seems this function name is banned ??? // snipped LCD_STROBE ; __delay_us(1); } with __delay_us(40); and replace this void LCDClear() { LCDCommand(0x01); } with this void LCDClear() { LCDCommand(0x01); __delay_ms(1.64 - 0.04); } And do send 0x28 instead of 0x40 as Qub said. |
|
|
|
|
|
嗨,看起来你不使用XC8编译器。你使用的LCD模块有一个KS000 66控制器芯片,它是HD4780兼容的:http://wwwDaseHETSPDF…半导体/KS9006/1,所以你可以在因特网上查看大部分的LCD库,因为HD44 780是一个标准,至少从VI的命令点来看。从一个LCD IC设备到另一个LCD设备的变化是定时。因此,如果你找到一些例子来检查控制器IC的时序,如果你使用XC8,你会发现一个用于PICDEM2 PLUS板的这种芯片的软件LCD驱动程序(KS000 66 /HD44 780当量):HTTP://www. MyCHIP.COM/DealthOrthsStudio/StudioDeLiel.ASPX?PARNONO=DM163022-1
以上来自于百度翻译 以下为原文 Hi, It seems you don't use XC8 compiler. The LCD module you use has a KS0066 controller IC which is HD44780 compatible : http://www.datasheetspdf....semiconductor/KS0066/1 So you can e.g. look at most of the LCD libraries on internet because HD44780 is a standard, at least from the commands point of view. What changes from one LCD IC device to the other are the timings. So if you find some example check the timings of the controller IC. If you use XC8, you will find a software LCD driver for this kind of chip (KS0066 / HD44780 equivalent) for the PICDEM2 PLUS board : http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=DM163022-1 Regards |
|
|
|
|
|
假设HD44 780大部分是这些类型。下载数据表。
以上来自于百度翻译 以下为原文 Assuming HD44780 which most of these type are. Download the datasheet. |
|
|
|
|
|
使用RSPICI AM使用DSPIC33 EP32 MC202,所以使用XC16。
以上来自于百度翻译 以下为原文 @RISC I am using dsPIC33EP32MC202 so xc16 is used. |
|
|
|
|
|
|
|
|
|
|
|
@ QHB,@ 1and 0和@ TS9.谢谢,我会尝试然后更新给你明天。
以上来自于百度翻译 以下为原文 @qhb ,@1and0 and @TS9 Thanks I will try then update to you tomorrow. |
|
|
|
|
|
嗨,所以如果你使用一个DSIC33,你可以参考任何应用笔记或软件例子为Excel 16或Excel 1632,并使用LCD显示器,它也有一个基于HD44 780的LCD控制器IC。在这个页面上的ExpReal16演示代码:HTTP://www. MyCHIP.COM/DeavigoToSs/OpjtDebug?ASPX?PARNONO=DMA24000
以上来自于百度翻译 以下为原文 Hi, So if you use a dsPIC33, you can refer to any application note or software example for EXPLORER16 or EXPLORER1632 and uses LCD display. It also has a HD44780 based LCD controller IC. Explorer16 demo code on this page : http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=DM240001 Regards |
|
|
|
|
|
正如预期的演示代码。关于启动器的效率:无论是谁编写的,都不知道LCD是如何工作的,因为一个清晰的屏幕命令将自动返回光标到家中,因此第二个LCDAsEnEngDebug()不需要。(而且我还没有看过其他的功能。
以上来自于百度翻译 以下为原文 As expected from a demo code. Regarding efficiency for starter: void LCD_ClearScreen ( void ) { LCD_SendCommand ( LCD_COMMAND_CLEAR_SCREEN , LCD_S_INSTR ) ; LCD_SendCommand ( LCD_COMMAND_RETURN_HOME , LCD_S_INSTR) ; row = 0 ; column = 0 ; } Whoever coded this has no idea how a LCD works, because a Clear Screen command will automatically return the cursor to home; so the second LCD_SendCommand() is unnecessary. :( And I have not looked at the other functions yet. |
|
|
|
|
只有小组成员才能发言,加入小组>>
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评论
/7
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 03:48 , Processed in 1.876316 second(s), Total 81, Slave 75 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
355