Jump to content

jetster94

EstablishedMember
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jetster94

  • Rank
    Newbrie
  1. Finally I managed to make the lcd work. The infinite loop in lcd_setup is inherent to the constant declaration. When setting use busy, the busy signal is not simulated by the debugger so it is still wait for a not busy state. So in order to simulate a lcd properly, you have to set use time delays and then switch to use busy when implementing on the PIC. Hope to see you guys with another issue !!
  2. I don't really get what you mean. When I launch the program, each lines of the execution section are executed, line by line, and the registers are storing all expected values. That's why I don't believe my code is equal to an unedited main function. I don't understand why, when the program enters the lcd_setup() function, it is never going out from it in order to execute the following instructions such as lcd_clear(), lcd_gotoxy(), etc... Regards
  3. Changing adcon was a good idea, but the debugger still runs lcd_setup in an infinite loop. Did anyone try to simulate this?
  4. Hi, I'm back with a new deadly issue. I'm trying to drive a lcd with a PIC16F873. #include <system.h> #define LCD_ARGS 1, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \ 1, /* Use busy signal: 1 = use busy, 0 = use time delays */\ PORTC, TRISC, /* Data port and data port tris register */ \ PORTA, TRISA, /* Control port and control port tris register */ \ 1, /* Bit number of control port is connected to RS */ \ 3, /* Bit number of control port is connected to RW */ \ 2 /* Bit number of control port is connected to Enab
  5. Hi ! Before looking for a place in a graveyard I 'd require your help about a common and meaningless error : missing semicolon. The program was working perfectly UNTIL I added this lcd_setup function. #include <system.h> #define LCD_ARGS 2, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \ 1, /* Use busy signal: 1 = use busy, 0 = use time delays */\ PORTC, TRISC, /* Data port and data port tris register */ \ PORTA, TRISA, /* Control port and control port tris register */ \ 1, /* Bit number of control port is connected to RS */
  6. Thanks a lot Dave for your advice. This had solved the condition testing problem. I used to write && for bit masking in LabWindows CVI, such differences may arise when using different compilers, this will be an excellent thing to bear in mind in the future. Anyway, I maintain the bug concerning portA register and led block failure in debugger mode.
  7. Bug description: When using a switch/case structure or if/ else if structure, the code seems to be executed regardless of the inputs. Steps to reproduce: Here is the code source. A simple program that performs a LED flashing on port A according to the word presented on port B. #include <system.h> char read; void main() { trisb = 0xFF; //configure port B trisa = 0x00;//configure port A spbrg = 25; // Asuart config for future apps. txsta = 0x26; rcsta = 0x90; #ifdef _PIC16 porta = 0x00; //clear port A #endif while(1) //endless loop { r
  8. Hi ! I've just written a simple program using PIC16F873. Configuring port b as input and port a as output, my program is using a switch/case structure. First, the bit masking does not seem to work properly when written in that way. Secondly, even if I present 0x03 on port b, the "case 0x01" is being executed anyway. Note that the first case 0x00 works properly. The debugger is also behaving in that "strange" way. COuld you please help me? Thanks!! --------------------------- void main() { trisb = 0xFF; //configure port B trisa = 0x00; spbrg = 25; txsta = 0x26;
×
×
  • Create New...