It is currently 15 Oct 2018 20:05

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 08 Aug 2017 03:09 
Offline

Joined: 29 May 2011 01:41
Posts: 15
I am working on an LCD project that originally had the LCD pins connected to PIC port D. We've changed and moved the LCD to port A since only six pins are used (RS, E, D4-D7). Since making the change I cannot get the LCD to work which I think has to do with the TIMER0 function although not certain. I've disabled the A/D. Below is a snippet of the code:

// LCD connections
  LCD_RS : sbit  at RA0_bit;
  LCD_EN : sbit  at RA1_bit;
  LCD_D4 : sbit  at RA2_bit;
  LCD_D5 : sbit  at RA3_bit;
  LCD_D6 : sbit  at RA4_bit;
  LCD_D7 : sbit  at RA5_bit;

  LCD_RS_Direction : sbit at TRISA0_bit;
  LCD_EN_Direction : sbit at TRISA1_bit;
  LCD_D4_Direction : sbit at TRISA2_bit;
  LCD_D5_Direction : sbit at TRISA3_bit;
  LCD_D6_Direction : sbit at TRISA4_bit;
  LCD_D7_Direction : sbit at TRISA5_bit;
// End LCD Connections


  TRISA := %00000000;
  ADCON1 := %00000110;
  TMR0 := 1;


Am I correct it is a timer0 issue? We should be able to move the LCD to port B if that would work. How can I resolve this?

Thanks.


Top
 Profile  
 
PostPosted: 08 Aug 2017 23:21 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4978
I don't use mE's LCD library so I can offer little help with it, but I don't think Timer0 has anything in common with it. (Naturally, enabling Timer0 interrupts without servicing them could disrupt any code :) ).

I have only one suggestion - do not modify TRISA after initializing Lcd_Init(), and a remark - RA4 pin has open-drain output, so one has to add a pull-up resistor to use it as standard output (it'd be better to use this pin as one of the control lines).

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: