I've been working on a project for the past few months but now have an issue which is causing my grey hair to fall out !
The project was developed on my trusty old EasyPIC5 board and solderless breadboad, and worked fine. Initially I was using an 18F4620 and a this was used to build a prototype on veroboad strip board, which worked well. As I don't really need all the 40 pins on the 18F4620 I ported the code to an 18F2620 and tested that in the Easypic5 board, which worked fine. So I decided to have some boards made, and spent weeks coming up with a final version that checked out and looked good. I sent the gerbers off and the boards arrived yesterday. I spent around three hours last night building a board only to find that the LCD just displayed one line of blocks. It was rapidly approaching 1am so I retired to bed.
Now I'm not sure if it's simply my iron isn't hot enough, or they's used lead free solder in the plating process, but all the pins that connect to the ground plane are a slightly brighter colour and are a bitch to solder, so thinking that it might be a dry joint I took another board (I have 5 to play with) and this time belled each connection out to ensure it followed the schematic before placing the components just for the PIC and LCD. So basically I just have the 28pin DIL socket, 10mhz crystal, two 22pf caps, 1k LCD backlight resistor, 10k MCLR pull up resistor and the 10k pot on the board. Connected up a 5v supply and I get the same thing. I also get the same thing if I power up the LCD in the Easypic5 board without the PIC inserted, so it's like the pick isn't running. If I plug the PIC back in the development board it runs fine.
The only thing that is different between the stripboard prototype and the PCB schematic is that all unused pins are grounded. So I have a hunch that possibly I need to change something in the config of the code to disable those pins just in case this is causing the PIC to lock up ?? - or possibly I'm barking up the wrong tree !
I've attached the centre section of the schematic, which I've belled out with a continuity tester on the board, and it all rings true with no shorts. The LCD follows the same layout as the diagram in the easypic5 manual, and also bells out correctly. I've also included the config settings for the ports, just in case I'm missing something,.
Any suggestions ?
Code:ASM __CONFIG _CONFIG1H, _OSC_HS_1H __CONFIG _CONFIG2L, _PWRT_ON_2L __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H __CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L ENDASM '******************************************************************************* ' LCD (20 x 4) set up '******************************************************************************* DEFINE LCD_DREG PORTB ' LCD Data port DEFINE LCD_DBIT 0 ' starting Data bit (0 or 4) DEFINE LCD_EREG PORTB ' LCD Enable port DEFINE LCD_EBIT 5 ' Enable bit (on EasyPIC 5 LCD) DEFINE LCD_RSREG PORTB ' LCD Register Select port DEFINE LCD_RSBIT 4 ' Register Select bit (on EasyPIC 5 LCD) DEFINE LCD_BITS 4 ' LCD bus size (4 or 8 bits) DEFINE LCD_LINES 4 ' number of lines on LCD DEFINE LCD_COMMANDUS 2000 ' Command delay time in us DEFINE LCD_DATAUS 50 ' Data delay time in us '******************************************************************************* ' Defines Statements '******************************************************************************* DEFINE OSC 20 ADCON1 = $0F clear '******************************************************************************* 'Analog and Comparator settings '******************************************************************************* ADCON0 = %00000000 'AD converter module disabled ADCON1 = %00001111 'All Digital ADCON2 = %00000000 CMCON = 7 'Disable Comparators '******************************************************************************* 'Port settings '******************************************************************************* TRISA = %00010111 TRISB = %00000011 TRISD = %00000011 T0CON = %11000111
Bookmarks