bigdogguru
Administrator
- Joined
- Mar 12, 2010
- Messages
- 9,821
- Helped
- 2,350
- Reputation
- 4,694
- Reaction score
- 2,272
- Trophy points
- 1,413
- Location
- Southwest, USA
- Activity points
- 62,383
Heya
The code FINALLY works! =D After struggling for more than a month, IT FINALLY WORKS ! Ive never been so happy in my life
I pulled out Jumper J20 and J21 and the code works ! ( the first time code worked with the 2 jumpers on though) I now have J20-J23 out !
I am using PICDEM2 Plus.
From the board manual : J20-J23 is for PIC MCU to I2C bus
How do you enter a new line?
putrsUSART("/n/r") doesn't seem to work.
putrsUSART("\n\r");
I have this : **broken link removed**
Why are there 2 jumpers for Tx and Rx?? One needs to be in place at a time?
void WaitLCD(void)
{
UINT8_T Status; // Local buffer for LCD status
UINT16_T TimeOut_Counter = 0;
LCD_RS = CLEAR; // Let the LCD know it's getting a command
LCD_RW = READ; // Specify a read command
do
{
Status = ReadByte(); // Get LCD state
if (TimeOut_Counter == TimeOut_Max) // WaitLCD Timeout Error
{
do{ LATBbits.LATB3 = LATBbits.LATB2 = LATBbits.LATB1 = ENABLE; }while(1);
}
TimeOut_Counter++;
} while (Status & 0x80); // If bit 7 high => LCD busy
LCD_RW = WRITE; // LCD is now in read mode (MCU in write mode)
ClrWdt(); // Precautionary Clear of Watch DOG Timer
TimeOut_Counter = 0;
}
void WaitLCD(void)
{
UINT8_T Status; // Local buffer for LCD status
UINT16_T TimeOut_Counter = 0;
LCD_RS = CLEAR; // Let the LCD know it's getting a command
LCD_RW = READ; // Specify a read command
do
{
Status = ReadByte(); // Get LCD state
if (TimeOut_Counter == TimeOut_Max) // WaitLCD Timeout Error
{
do{ LATBbits.LATB3 = LATBbits.LATB2 = LATBbits.LATB1 = ENABLE; }while(1);
}
TimeOut_Counter++;
} [COLOR="#FF0000"]while (Status & 0x80); // If bit 7 high => LCD busy[/COLOR]
LCD_RW = WRITE; // LCD is now in read mode (MCU in write mode)
ClrWdt(); // Precautionary Clear of Watch DOG Timer
TimeOut_Counter = 0;
}
What will be the required measurable frequency range of the system?
BigDog
freq = ReadTimer1(); // get frequency reading from timer1 counter mode
ultoa(freq,str,10);
LCDGoto(0,0);
LCDWriteStr("Counter:");
LCDWriteStr(str);
putrsUSART(str);
putrsUSART("\n\r");
"str' is initialised as char str[10]
ultoa
Function: Convert an unsigned long integer to a string.
Include: stdlib.h
Prototype: char * ultoa( unsigned long value, char * string);
Arguments: value
An unsigned long integer to be converted.
string
Pointer to ASCII string that will hold the result.
Remarks: This function converts the unsigned long integer in the argument value
to a ASCII string representation. string must be long enough to hold the ASCII representation,
including a trailing null character. This function is an MPLAB C18 extension to the ANSI required
libraries.
Return Value: Pointer to the result string.
File Name: ultoa.asm
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?