searching for help...

Status
Not open for further replies.
Nigel Goodwin said:
Have you programmed the PIC to read from RS232?, if it's just a blank PIC how do you expect it to work?.

i just want to test whether the pc can send data to MAX232 or not... but the voltage of the RS232 cable seems constant... maybe i shouldn't do that way...

Nigel Goodwin said:
If your project is due in four weeks?, I think you're in deep s**t - starting from zero knowledge of PIC's you've got a LOT! to do.

this i have to agree with you :cry:

frankly, i don't have any idea of my project... end of my world...
anyway, i did found some IR bits... found MP2120... but not really sure if that is suitable...
 
checkmate said:
I'll teach you something better. It's called reading the datasheets. Try interpreting what the datasheet says for movwf.

where can i get the full datasheet for assembly or PIC18f452? from microchip, there seems like one p18fXXX, is that the one?
 
**broken link removed**

Also, the "Complete PIC18C Reference Manual" found **broken link removed** is the general reference for all PIC18 chips.
 
**broken link removed**

The name PIC18FXX2 is a bit odd, but it looks like it's the one.

You might wanna grab the 18F4520 datasheet while you're there, since the 18F452 is being phased out by Microchip and replaced by the 18F4520.

BTW, there is a *lot* of good documentation on Microchip's website. Not always 100% accurate, but for a hardware manufacturer, they are doing a very good job at maintaining the equivalent of a several thousand pages encyclopedia in datasheets, app & design notes, etc. When you start considering the amount of documentation they put out each year, you realize Microchip is almost as much a publisher as it is a microcontroller designer & manufacturer!

Just for fun : let's say there are about 200 different PICs (it's more than that), with the average datasheet being 200 pages (a lot are more than that). 200x200 == 40 000. Add all the app notes, erratas, design notes, datasheets for analog, non-uC stuff. We're talking several hundreds of thousands of pages... :shock:
 

i want to know as badly too ... but it seems that im really confused about how to start .. maybe the main thing is that i know so little bout assembly language.. i started off with the datasheet .. then i found out that there are so many terms i dont understand . then i went to Nigel's tutes.. same thing.. i learn the most when i ask questions 1 by 1 here... but time's running out for me to complete my project.. any suggestions on how to organize learning PIC for a assembly language newbie too??
 
Some advice (works for almost all processor types). Grab any sample program that implements serial comms, and try your very best (yes, time to bite the bullet here) to understand it, referring to the datasheet whenever you have queries. Firstly, such a program normally packs most of the features of any other program, hence serves as a good starting template. Secondly, the UART is the simplest way to throw debugging outputs to (using hyperterminal).
 
Yes, start with flashing LEDs, then Add USART, PWM, LCD, EEPROM and you are done
(LCD was a killer for me)
 
Well LCDs can display anything, some strings, numbers, symbols.
I used it as my serial LCD terminal (displayed everything that came throu USART), or thermometer, or my power supply unit, possibilites are infinite.
 
#include <p18f452.h>
#include <usart.h>

#pragma romdata CONFIG
_CONFIG_DECL(_CONFIG1H_DEFAULT & _OSC_HS_1H,
_CONFIG2L_DEFAULT & _BOR_ON_2L & _BORV_42_2L,
_CONFIG2H_DEFAULT & _WDT_OFF_2H,
_CONFIG3H_DEFAULT,
_CONFIG4L_DEFAULT & _LVP_OFF_4L,
_CONFIG5L_DEFAULT,
_CONFIG5H_DEFAULT,
_CONFIG6L_DEFAULT,
_CONFIG6H_DEFAULT,
_CONFIG7L_DEFAULT,
_CONFIG7H_DEFAULT);
#pragma romdata

void main(void)
{
unsigned char c;

/* Configure all PORTB pins for output */
TRISB = 0;

OpenUSART (USART_TX_INT_OFF &
USART_RX_INT_ON &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_HIGH, 129);

/* Display a prompt to the USART */
putrsUSART ("\n\rEnter 0 or 1!\n\r") ;

while(1)
{
while(!DataRdyUSART())
;

/* Get the character received from the USART */
c = ReadUSART();
if (c == '0')
{
PORTB = 0;
}
else if (c == '1')
{
PORTB = 1 ;
}
}

CloseUSART() ;
}



is there any problem with my code here? Fosc is 20MHz, 9600 Baud rate, 8 bits, no parity, 1 stop bit.
 
actually, i just want to test a simple send and receive command. i able to send the string, but seem like i can't receive any thing from the serial port. i want to check the character i received (either '0' or '1') with an LED. i have double check the circuit, no problem with that. is the receive part of the programming causing problem? pls help me... thank you...
 
Maybe the fact that he has his 'RX_INT_ON' (receive interrupt on) in the above code, while there was no ISR.
 
Exo said:
Maybe the fact that he has his 'RX_INT_ON' (receive interrupt on) in the above code, while there was no ISR.

Well, I'm just curious how the PC interuppted the PIC. I have experienced some problems wherein the Interrupt Signal on the INT pin hasnt lastet long enough to do the trick !
 
actually, i didn't change anything in the code... just click 2 buttons (set DTR and set RTS) in the terminal program... then everything works already... don't really know what happen... hehe... still new in PIC... doesn't really know the code... will continue exploring on thursday...
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…