Darrel,
Thank you for the answers but i'm lost now...
How does hyperterminal work when transfering a text file over com port? It simply sends all the file as a bytes stream and inserts a user defined delay between each of the bytes, until it reaches the eof? So that's why we don't need flow control?
Then i have to poll a bit that will tell me when the 8 bits of the transfered byte have filled the usart buffer? And if so i copy the buffered byte in an array for example?
Hserin takes care only of reading bits incoming on rx pin and setting the buf-full flag bit?
Did i get it well?
By the way, i remember from my old C programming days that there is a differece between Ascii and binary files (ascii may be interpreted for lf and cr characters... as this is no pc 'getch' handling we don't care if hyperterminal sends it as ascii, right?)
One last thing, i've checked the dataseet for 18f252 and 452, besides the memory size and psp and i/o pins count, i could as well use a cheaper 252 instead of 452 if it is to receive a file from pc into an spi eeprom and then send it to a 16bits dac. Both pics can run at 40mhz with 10mhz crystal and pll?
By the way... why would I need USART at all. Can't I poll an input pin connected to PC serial TX (out) and get bits one after another and build bites and transfer them to memory. I could even use an interrupt to know when a byte is incming...?




Bookmarks