![]() |
![]() |
![]() |
|
|
|||||||
| 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) |
|
I was googling for some tutorials on how to interface this particular glcd with a PIC18F452, and I came across a few threads in here. I started digging through the forum and came across that Unicorn example from Pommie, and I read through it and realized he was using a ks0108, not a ks0108b. Is the b version that different where if I were to port his code to an 18F452 that it wouldn't work? ..because I tried out of curiosity and wasn't getting _any_ output.
I'm using the same compiler he is. Cheers! |
|
|
|
|
|
|
(permalink) | |
|
Quote:
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 20th April 2008 at 02:53 AM. |
||
|
|
|
|
|
(permalink) |
|
I was actually reading your post, and the exchange you and Pommie had futz, thanks for the link I'll scope it out.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
Tried it out, and I have literally _nothing_ showing up on the display. I ported it to MCC18, but that just involved changing some tris statements to match the ones I am using (TRISB for data and TRISA for the modal pins like chip select, etc). I hooked up an oscilloscope to a few of the data pins, and _tons_ of data is moving over them. But ya, data is hooked up to PORTB, and the chip select and other modes are wired to PORTA. This is all on a pic18f452. Like i said, code is identical to yours... although I'm not sure what you're setting up in that #pragma at the start and that could be part of the reason. |
||
|
|
|
|
|
(permalink) |
|
Tried it out, and I have literally _nothing_ showing up on the display. I ported it to MCC18, but that just involved changing some tris statements to match the ones I am using (TRISB for data and TRISA for the modal pins like chip select, etc).
I hooked up an oscilloscope to a few of the data pins, and _tons_ of data is moving over them. But ya, data is hooked up to PORTB, and the chip select and other modes are wired to PORTA. This is all on a pic18f452. Like i said, code is identical to yours... although I'm not sure what you're setting up in that #pragma at the start and that could be part of the reason. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
||
|
|
|
|
|
(permalink) |
![]() ok, so in that picture PORTB-RB0 -> DB0; PORTB-RB7->DB7 (0 goes to 0, 1 goes to 1, etc) for the data. for the other pins, D/I -> RA2, R/W -> RA1, E->RA0, CS1->RA3, CS2->RA4, RESET->RA5. code is attached. I REALLY appreciate the help. I hope the schematic isn't too confusing, I just whipped it up in Visio as fast as I could seeing as you're "around." Also, all the power sources, VDD, etc are 5 volts. The VEE is hooked up to a potentiometer and is getting ~1-2 V. I think the problem might lie in the #pragma statement, because I didn't modify it at all, and am not positive what you're doing there. I was just hoping to get _something_ to display so I could study how you were doing it. Again, thanks for any help you might be able to provide. Last edited by desaila; 22nd April 2008 at 11:24 PM. |
|
|
|
|
|
|
(permalink) |
|
I think you need to change your #defines to use the latch rather than the port.
Code:
#define DI LATAbits.LATA2 Mike. |
|
|
|
|
|
|
(permalink) |
|
i have some experience with the pic18f452, but not a whole lot. i've never used the "lat" before and never saw them used until a glcd example in code of your's pommie. what's the motivation for lat's?
|
|
|
|
|
|
|
(permalink) | ||
|
Quote:
Quote:
Desaila, I haven't even looked at either the schematic or the code yet. Was having a nap. Now I'll have food. Then I'll look.
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
|||
|
|
|
|
|
(permalink) |
|
Fair enough. This is for a big projec that's due in ~2 weeks. I have all the rest of the stuff done, RFID, MMC, but the glcd is really giving me a headache. I definitely appreciate this forum and everything I've seen on it.
|
|
|
|
|
|
|
(permalink) |
|
Desaila,
Futz is probably right and the Latch/Port probably won't matter but safer to change it just in case. Have you turned off any analogue ports? (ADCON1=0x06 for the 18F452) Mike. |
|
|
|
|
|
|
(permalink) |
|
No, I haven't turned any off. Why would that matter? (not disagreeing wtih you, but I'm curious)
|
|
|
|
|
|
|
(permalink) |
|
Analogue pins work fine as digital outputs but always read back zero when you access the Port register. This really messes up any bit read/write operations.
Mike. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
Code:
#pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC & _LVP_OFF Here's a set of typical BoostC pragmas for an 18F452 Code:
#pragma DATA _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H #pragma DATA _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_OFF_2L #pragma DATA _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H #pragma DATA _CONFIG3H, _CCP2MX_ON_3H #pragma DATA _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L #pragma DATA _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L #pragma DATA _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H #pragma DATA _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L #pragma DATA _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H #pragma DATA _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L #pragma DATA _CONFIG7H, _EBTRB_OFF_7H Code:
#pragma CLOCK_FREQ 32000000 #pragma DATA _CONFIG1H, _OSC_INTIO67_1H #pragma DATA _CONFIG2H, _WDT_OFF_2H #pragma DATA _CONFIG3H, _MCLRE_ON_3H #pragma DATA _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L All the above assumes BoostC. Your compiler may have different syntax.
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 23rd April 2008 at 02:34 AM. |
||
|
|
|
| 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 |