![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Just to be on the safe side, change these
Code:
#define DI PORTAbits.RA2 #define RW PORTAbits.RA1 #define E PORTAbits.RA0 #define CS1 PORTAbits.RA3 #define CS2 PORTAbits.RA4 #define RST PORTAbits.RA5 Code:
#define DI LATAbits.RA2 #define RW LATAbits.RA1 #define E LATAbits.RA0 #define CS1 LATAbits.RA3 #define CS2 LATAbits.RA4 #define RST LATAbits.RA5
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) | |
|
Quote:
Sorry if I sound grumpy, but that was a really dumbass question.
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
||
|
|
|
|
|
(permalink) |
|
haha, fair enough.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
However, it says on a power on reset "these ports are configured as digital inputs." Then, I guess I see that there are no AD's associated with PORTB in the final summary of regs at the bottom of PORTB's section. So, ADCON1 = 0x07 then. |
||
|
|
|
|
|
(permalink) | |
|
Quote:
EDIT: Just looked. What you want is on page 182 of the datasheet. 0x06 will work, but so will 0x07 as the 0-bit is a don't-care in this case.
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 23rd April 2008 at 04:21 AM. |
||
|
|
|
|
|
(permalink) | |
|
Quote:
(no change in status of lcd). |
||
|
|
|
|
|
(permalink) | |||
|
Quote:
Quote:
Quote:
In your MCC18 dir you'll find an mpasm dir. In there you'll find a file called P18F452.INC. Near the bottom of that you'll find this list: Code:
; Oscillator Selection: ; OSC = LP LP ; OSC = XT XT ; OSC = HS HS ; OSC = RC RC ; OSC = EC EC-OSC2 as Clock Out ; OSC = ECIO EC-OSC2 as RA6 ; OSC = HSPLL HS-PLL Enabled ; OSC = RCIO RC-OSC2 as RA6 ; ; Osc. Switch Enable: ; OSCS = ON Enabled ; OSCS = OFF Disabled ; ; Power-up Timer: ; PWRT = ON Enabled ; PWRT = OFF Disabled ; ; Brown-out Reset: ; BOR = OFF Disabled ; BOR = ON Enabled ; ; Brown-out Voltage: ; BORV = 45 4.5V ; BORV = 42 4.2V ; BORV = 27 2.7V ; BORV = 25 2.5V ; ; Watchdog Timer: ; WDT = OFF Disabled ; WDT = ON Enabled ; ; Watchdog Postscaler: ; WDTPS = 1 1:1 ; WDTPS = 2 1:2 ; WDTPS = 4 1:4 ; WDTPS = 8 1:8 ; WDTPS = 16 1:16 ; WDTPS = 32 1:32 ; WDTPS = 64 1:64 ; WDTPS = 128 1:128 ; ; CCP2 MUX: ; CCP2MUX = OFF Disable (RB3) ; CCP2MUX = ON Enable (RC1) ; ; Stack Overflow Reset: ; STVR = OFF Disabled ; STVR = ON Enabled ; ; Low Voltage ICSP: ; LVP = OFF Disabled ; LVP = ON Enabled ; ; Background Debugger Enable: ; DEBUG = ON Enabled ; DEBUG = OFF Disabled ; ; Code Protection Block 0: ; CP0 = ON Enabled ; CP0 = OFF Disabled ; ; Code Protection Block 1: ; CP1 = ON Enabled ; CP1 = OFF Disabled ; ; Code Protection Block 2: ; CP2 = ON Enabled ; CP2 = OFF Disabled ; ; Code Protection Block 3: ; CP3 = ON Enabled ; CP3 = OFF Disabled ; ; Boot Block Code Protection: ; CPB = ON Enabled ; CPB = OFF Disabled ; ; Data EEPROM Code Protection: ; CPD = ON Enabled ; CPD = OFF Disabled ; ; Write Protection Block 0: ; WRT0 = ON Enabled ; WRT0 = OFF Disabled ; ; Write Protection Block 1: ; WRT1 = ON Enabled ; WRT1 = OFF Disabled ; ; Write Protection Block 2: ; WRT2 = ON Enabled ; WRT2 = OFF Disabled ; ; Write Protection Block 3: ; WRT3 = ON Enabled ; WRT3 = OFF Disabled ; ; Boot Block Write Protection: ; WRTB = ON Enabled ; WRTB = OFF Disabled ; ; Configuration Register Write Protection: ; WRTC = ON Enabled ; WRTC = OFF Disabled ; ; Data EEPROM Write Protection: ; WRTD = ON Enabled ; WRTD = OFF Disabled ; ; Table Read Protection Block 0: ; EBTR0 = ON Enabled ; EBTR0 = OFF Disabled ; ; Table Read Protection Block 1: ; EBTR1 = ON Enabled ; EBTR1 = OFF Disabled ; ; Table Read Protection Block 2: ; EBTR2 = ON Enabled ; EBTR2 = OFF Disabled ; ; Table Read Protection Block 3: ; EBTR3 = ON Enabled ; EBTR3 = OFF Disabled ; ; Boot Block Table Read Protection: ; EBTRB = ON Enabled ; EBTRB = OFF Disabled Code:
#pragma config OSC = HS #pragma config WDT = OFF #pragma config LVP = OFF Code:
#include <p18cxxx.h>
#include <delays.h>
#pragma config OSC = INTIO67, WDT = OFF, LVP = OFF
void main(void)
{
TRISD = 0;
while(1){
LATDbits.LATD1 = 1;
Delay100TCYx(100);
LATDbits.LATD1 = 0;
Delay100TCYx(100);
}
}
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 24th April 2008 at 06:20 AM. |
||||
|
|
|
|
|
(permalink) |
|
Thanks a bunch! I'm not going to be in the lab again tonight, but I'm going to head over there first thing in the morning to give this a go.
|
|
|
|
|
|
|
(permalink) |
|
heh, so I just changed some of the init things to test out, and i was playing with the contrast potentiometer i have setup, and the thing started smoking...(not the pot, but the lcd itself.) I cut the power as quick as I could and turned it over to investigate and nothing looks damaged.
so now i'm petrified that it burnt out. Is there a way to verify that the lcd might actually be working despite nothing showing up on it? EDIT: Also, in case the thing is still working... I'm using a 20 mhz oscillator, so should I be using a Delay1KTCYx() instead of the Nops? Or do you have like simplified code that just puts out like 1 letter to the device or something, so I can just try adn get the timing down on this thing and verify if it's really dead or not? (sorta like your blinky program)? Last edited by desaila; 24th April 2008 at 04:57 PM. |
|
|
|
|
|
|
(permalink) |
|
Smoke = bad. LCD displays are very sensitive to incorrectly applied power and such. I've killed a couple in my day from just a brief power reversal.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
Aye, tbh I think it has something to do wtih the company. The first LCD I got from them smoked the first time I wired it up. I called them, told them what happened and that I tested all the voltages prior to wiring it up, and after the failure and they wre all within operating range. They sent me a new one for free, the second one they sent me is the one I have now. I had my professor help me wire it, test all the voltages before we wired it up, etc. So I really don't think it's my fault, maybe it was =/ |
||
|
|
|
|
|
(permalink) | ||||
|
Quote:
Quote:
Quote:
Quote:
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 24th April 2008 at 11:57 PM. |
|||||
|
|
|
|
|
(permalink) |
|
I understand the nature of this lcd not being text driven and having to get your own character libraries, etc
Also, I have it wired in a very similar way. Just a potentiometer instead of a 10k. It wasn't just my professor either, I had the TA double check it prior to firing it up for the first time. It was fine for ~2 weeks and them smoked. Is that something that can be expected? |
|
|
|
|
|
|
(permalink) | ||
|
Quote:
Quote:
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
|||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| COnnecting 2 telephone Sets via optical coupler | waqar | General Electronics Chat | 4 | 20th April 2008 03:07 AM |
| Xbox 360 Tilt Controller | adamthole | Electronic Projects Design/Ideas/Reviews | 0 | 20th January 2007 05:24 PM |
| closed loop controller that receives set point updates TXRX | usacanbiteme | Electronic Projects Design/Ideas/Reviews | 5 | 28th September 2005 09:02 PM |
| Motor controller for a e-motor/generator Combo | dreamtoys | Electronic Projects Design/Ideas/Reviews | 1 | 3rd October 2003 11:42 PM |
| Help With Temperature Controller | bryan | Electronic Projects Design/Ideas/Reviews | 4 | 30th June 2003 12:18 PM |