完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我想在LCD引脚上移动数据,它连接在PIN号12、13和15端口上,将为PORTB提供逻辑工作,引脚0到7,然后12到15引脚。我使用的是P24FJ64 GC010控制器
以上来自于百度翻译 以下为原文 I want to move data on LCD pin which connected on pin number 12,13 and 15 portB, Will given logic work for portB have pin 0 to 7 and then 12 to 15 pin. I am using p24fj64gc010 controller void dis_cmd(unsigned char cmdout) { unsigned int cmdout1; cmdout1 = (cmdout << 4 )& 0xF00; cmd(cmdout1); delay_ms(10); cmdout1 = (cmdout <<8 )& 0XF00; cmd(cmdout1); delay_ms(10); } void dis_data (unsigned char dataout) { unsigned int dataout1; dataout1 = (dataout << 4 ) & 0xF00; data(dataout1); delay_ms(10); dataout1 = (dataout << 8 ) & 0xF00; data(dataout1); delay_ms(10); } |
|
相关推荐
9个回答
|
|
请解释你以前和现在的原理图
以上来自于百度翻译 以下为原文 Mmmm, please explain better your previous and current schematics |
|
|
|
消息1中的代码不显示I/O实际上是如何完成的。所显示的代码看起来像4位并行字符LCD输出函数的一部分,但是调用函数:数据(NIWBLE);和CMD(NIBLE);执行实际输出。您必须研究这些函数中的内容以了解它是如何完成的。迈西尔
以上来自于百度翻译 以下为原文 Code in message #1 do not show how I/O is actually done. The code shown look like some part of 4 bit parallel character LCD output function, but call functions: data(nibble); and cmd(nibble); to perform actual output. You must study what is inside those functions to understand how it is done. Mysil |
|
|
|
|
|
|
|
|
|
|
|
控制器的引脚数12与控制器的LCDPIN号码13的数据引脚4连接,控制器的LCDPIN号14的数据引脚5与控制器的LCDPIN号15的数据引脚6连接到包含PoPb从引脚0到7的LCD微控制器的数据引脚7。然后,12至15控制器引脚连接在RF 12,13和RA1类似使能读/写和电阻选择。
以上来自于百度翻译 以下为原文 pin number 12 of controller is connected with data pin 4 of LCD pin number 13 of controller is connected with data pin 5 of LCD pin number 14 of controller is connected with data pin 6 of LCD pin number 15 of controller is connected with data pin 7 of LCD micro controller contain portB from pin 0 to 7 and then 12 to 15 controller pin is connected on RF12, 13 and RA1 like Enable Read/write and resistor select. |
|
|
|
正如伊恩在http://www. McCHIP.COM/FoMss/FordPase/77101和http://www. McCHIP.COM/FUMMS/FANDPOST/780169中提供的一些见解。
以上来自于百度翻译 以下为原文 as ian said in http://www.microchip.com/forums/FindPost/777101 and http://www.microchip.com/forums/FindPost/780169 may provide some insight |
|
|
|
|
|
|
|
这个代码不工作,我不知道为什么我已经使用它很多时间工作罚款,但这次不是。
以上来自于百度翻译 以下为原文 void int_lcd (void) { //dis_cmd ( 0x30 ); delay_ms(10); //dis_cmd ( 0x38 ); delay_ms(10); dis_cmd ( 0x02 ); // to initialize LCD in 4-bit mode. delay_ms(10); dis_cmd ( 0x28 ); //to initialize LCD in 2 lines, 5X7 dots and 4bit mode. delay_ms(10); dis_cmd ( 0x0C ); delay_ms(10); dis_cmd ( 0x06 ); delay_ms(10); dis_cmd ( 0x80 ); delay_ms(10); dis_cmd ( 0x01 ); } void dis_cmd(unsigned int cmdout) { unsigned int cmdout1; cmdout1 = (cmdout >> 4 ); cmd(cmdout1); delay_ms(10); cmdout1 = (cmdout ); cmd(cmdout1); delay_ms(10); } void dis_data (unsigned int dataout) { unsigned int dataout1; dataout1 = (dataout >> 4 ); data(dataout1); delay_ms(10); dataout1 = (dataout ); data(dataout1); delay_ms(10); } void data (unsigned int data) { lcdport = data; rw = 0; rs = 1; en = 1; delay_ms(10); en = 0; } void cmd (unsigned int cmd) { lcdport = cmd; rw = 0; rs = 0; en = 1; delay_ms(10); en = 0; } void delay_ms(unsigned int delay) { unsigned int i,j; for(i=0;i for(j=0;j<725;j++); } } This code is not working I do't know why I have used it many time work fine but not this time. |
|
|
|
嗨,在PIC24微控制器中的所有SFR控制寄存器是16位寄存器,但不是所有位都存在于所有寄存器中。您可以在每个寄存器中写入所有16位,但是那些没有存储单元的位将不会记住该值。当您从寄存器读取时,这些位将返回0。对于PIC2464 GC010,PORTB的寄存器没有PIN,并且没有用于RB8、RB9、RB10或RB11ee数据表DS3000 09312C页57的表14-4:PORTB寄存器映射。在消息9中所示的代码是不完整的。宏已经在其他文件中定义了,LCDyEngest.h或者别的什么。您将不得不研究该文件,并确保对您所连接的PIN的定义是正确的。如果你需要多问,你也必须显示该文件的内容。如果“LCDPATH”的定义是端口B的整个锁存寄存器,每次你写到端口:LCDPORT= CMD;该寄存器中的所有其他位也将被重写。B=(LATB&AMP;0xFFF0)*(CMD和0x000 0F);您说您以前使用过代码。PIC24FJ64 GC010是一个3.3伏的设备(MIN 2.0V,MAX 3.6V),你以前使用过3.3V微控制器的显示器吗?显示器的电源电压是多少?显示器的对比度控制脚上的电压是多少?当对比电压被调整时,有可能看到显示器上的光栅吗?在与显示控制器的4位通信中,首先传输数据字节的高字节,将数据线连接到RB12、RB13、RB14和RB15,可以这样做:在普通字符数据传输到显示器中时不需要长的延迟,最好是分离。ATE函数在初始化/重置显示期间写入单个4位命令小写,以及“LCDGIN()”中的控制延迟;“函数”。当PIC微控制器在MPLAB中编程时,微控制器被允许运行,并且在调试器具有控制权之前被重置几次。开始你的主程序。这可能使显示控制器处于未知状态。显示可能需要重置/初始化。这可以通过将电源切换到显示器控制器来进行,或者可以通过LCD控制和数据线上的软件命令来完成。在消息9中显示的代码不能正确地处理这个问题。
以上来自于百度翻译 以下为原文 Hi, All SFR control registers in a PIC24 microcontroller are 16 bit registers, but not all bits exist in all registers. You may write to all the 16 bits in every register, but those bits that do not have a memory cell, will not remember the value. When you read from the register, those bits will return 0. For PIC2464GC010 , Registers for PORTB have no Pins, and No memory for RB8, RB9, RB10 nor RB11 See datasheet DS30009312C-page 57 Table 14-4: PORTB Register map. Code shown in message #9 is incomplete. 'rw', 'rs', 'en' and 'lcdport' are probably macro's that have been #defined in some other file, lcd_define.h or something. You will have to study that file, and ensure that definitions there are correct for the pins you have connected. If you need to ask more, you have to show the content of that file also. If the definition of 'lcdport' is the entire Latch register for port B, every time you write to the port: lcdport = cmd; all other bits in that register will be overwritten also. It may be possible to avoid that overwrite by: LATB = (LATB & 0xFFF0) | (cmd & 0x000F); You say that you have used the code before. PIC24FJ64GC010 is a 3.3 V device ( min 2.0V, max 3.6V) Have you used the Display with a 3.3V microcontroller before? What is the supply voltage of the Display? What is the voltage on the Contrast control pin of the display? Is it possible to see the raster in display when Contrast voltage is adjusted? In 4 bit communication with Display Controller, the High nibble of data byte is transferred first. With Data lines connected to RB12, RB13, RB14 and RB15, it may be done like this: void dis_cmd(unsigned char cmdout) { unsigned int cmdout1; cmdout1 = (cmdout << 8 ) & 0xF000; LATB = (LATB & 0x0FFF) | cmdout1; rw = 0; rs = 0; en = 1; __delay_us(1); en = 0; delay_ms(10); /* Long delay is needed only during Initialization /Reset of display controller. */ cmdout1 = (cmdout << 12 ) & 0xF000; LATB = (LATB & 0x0FFF) | cmdout1; rw = 0; /* Not needed when LATB content is correctly preserved. */ rs = 0; /* Not needed when LATB content is correctly preserved. */ en = 1; __delay_us(1) en = 0; delay_ms(10); /* Long delay is needed only during Initialization /Reset of display controller } Since Long delays are not needed during ordinary character data transfer to the display, it may be better to make a separate function to write single 4 bit command nibbles, during Initialization / Reset of the Display, and control delays in 'lcd_init();' function. When a PIC Microcontroller is programmed in MPLAB, the microcontroller is allowed to run, and is Reset several times before the Debugger have control in the start of your main program. This may leave the Display controller in a unknown state. Display may have to be reset / initialized. This may be done by switching power to the display controller off and on, or may be done by software commands on LCD control and data lines. The code shown in message #9 do not do this correctly. Regards, Mysil |
|
|
|
只有小组成员才能发言,加入小组>>
5234 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
771浏览 1评论
659浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
588浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
670浏览 0评论
571浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 15:34 , Processed in 1.596642 second(s), Total 94, Slave 78 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号