HELP! Serial input between Pic and PC (urgent)


Closed Thread
Results 1 to 35 of 35

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    With SERIN and a MAX232 you need to use T9600.

    Try Sending Data fom your PIC to your PC to see what happen.

    I feel some hardware and configuration fuse problem here...

    You may also try with DEBUG/DEBUGIN...
    Last edited by mister_e; - 6th December 2007 at 04:10.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Consider using the USART

    Hi,

    Since you are using a PIC with hardware serial peripheral I suggest you use the hardware port if (your port pins are not used up). Even if your global interrupt is not set to handle interrupts (INTCON.7) the hardware flags inside the PIC always responds to an interrupt event. So you can just

    1. Poll the bit PIR1.5 (RCIF) for a 1 and if yes then
    2. Read the RCREG register to your own variable MySerialData = RCREG
    (Note the interrupt flag RCIF gets cleared once you read the data)
    3. Do your stuff
    4. Go back to the polling.

    Important to not that while you are processing and data can be grabbed by the module but if it is flooded again with data and you have not read the RCREG register then the overrun bit would be set which can be cleared by resetting and setting the CREN (continuos receive enable) bit.

    With Mister_e's PICMULTICALC utility configuring the registers for the hardware USART peripheral should not be any problem.
    Regards

    Sougata

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    May be the ADCON1=6 must be =7 ?

    I am not familiar with the A version of the 877. Steve?

    Ioannis

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    For five years I've been shouting DATASHEET at people. In the end it all falls on deaf ears...

    How the hell can you program for ANY device if you don't know and don't understand what's in the box? There are MAJOR differences between the A and non-A of this particular PIC. Oh and look... they just happen to affect PortA.3 as well...

    If you can't be bothered to do that, take a different class in school, get another hobby, change your job etc...

  5. #5
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    For five years I've been shouting DATASHEET at people. In the end it all falls on deaf ears...

    How the hell can you program for ANY device if you don't know and don't understand what's in the box? There are MAJOR differences between the A and non-A of this particular PIC. Oh and look... they just happen to affect PortA.3 as well...

    If you can't be bothered to do that, take a different class in school, get another hobby, change your job etc...
    That's considerably way too harsh! There's four ways we learn.

    1. Kinetic (doing / practical hands-on)
    2. Visually (charts, diagrams, mental problem solving)
    3. Verbally (Usually a person speaking)
    4. Reading & writing

    You're one very special creature if you're good at all four! Most mortals (including myself) - generally have strength in only about two of the aforementioned list. If you can solve all your problems by skimming over data sheets, then you have a nice strength with reading & writing and possibly also with visual. Most highly introverted people (like myself) tend to have a strength with visual & kinetic. So, to write someone off just because they haven't, or rather can't!!! - follow a data sheet terribly well is absurd!

  6. #6
    Join Date
    Nov 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Ioannis,
    I will try to check about it..

    Hi mister e,
    as u mentioned on the previous post about the hardware and configuration fuse problem, can u tell me more about that? I really want to learn about it...

    Thanks in advance

    Hi Melanie,
    First of all, thanks for your reply.

    I not sure what u answer me is related to the question that i asked about. But i can confirm that not every person come here and ask question without reading "DATASHEET". Maybe they are not understanding on some of the topic (include me) and try to looking for someone to help.

  7. #7
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Not all 877s are clock able @ 10MHz (some only go up to 4) - something to keep in mind.

  8. #8
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cmyew View Post
    But i can confirm that not every person come here and ask question without reading "DATASHEET". Maybe they are not understanding on some of the topic (include me) and try to looking for someone to help.
    The data sheet for the novice is generally out of the question. Much like a modern-day engine for a car that is entirely pre-assembled prior to fitting (they don't care about how awkward it is for the novice to change the starter motor) - data sheets are written primarily for an audience of individuals that have experience! If a data sheet was more like an "instruction manual" - I'd reserve little hesitation in telling you to go and read it.

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by T.Jackson View Post
    Not all 877s are clock able @ 10MHz (some only go up to 4) - something to keep in mind.
    I can confirm that every chip marked -4 was running perfectly doyble that, at 8 that is. Did not test more though...

    Quote Originally Posted by Melanie View Post
    For five years I've been shouting DATASHEET at people. In the end it all falls on deaf ears...
    Melanie, I can understand your response, but this forum is not restricted to pro's that know what to search for. Unless there is a restriction about the people that ask questions here, I think we have to tolerate also the absolute newbies. Even the lazy ones...

    Many times I did not reply just because the answer was so obvious, almost shouting from within the pages of the DS. Anyways...

    Ioannis

  10. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cmyew View Post
    Hi mister e,
    as u mentioned on the previous post about the hardware and configuration fuse problem, can u tell me more about that? I really want to learn about it...
    When possible, i suggest all forum member to post their schematic to see if it's done correctly. Psu filtering (0.1 uF + 10uF tantalum as close as possible of all Vdd/Vss jucntions), MLCR tied to Vcc directly or via resistor. etc etc

    Configuration fuses. Those need to be set before you program your PIC. Some feature might need to be disable, and some might need to be set properly depending of your OSC speed. Hence if there's any LVP, usually we set it to OFF, if the OSC/Crystal speed is >4 Mhz, OSC mode have to be set to HS.

    Look at the FAQ, there's whole thread about how to set the configuration fuses into your code. At least read post 1-5

    Presetting Configuration Fuses (PIC Defines) into your Program
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    HTH
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  11. #11
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I'm sorry I have to disagree...

    You can look at an internal combustion engine and figure which end turns and which end doesn't. You can figure where to bolt it down and couple it up. You can figure where to plumb the volts (if any), and fuel (and what kind) and where to plumb the water. But if you want to adjust timing, set spacing and clearances or other critical functions - guess what? You READ the manufacturers DATASHEET.

    But a PIC is just a plain black box with a heap of legs sticking out of it...

    Until you consult the Datasheet, you don't even know which legs need volts on them or even how much...

    Until you consult the Datasheet, you don't know where to plug-in your Xtal, or Resonator, or what kind will work or how to enable the internal oscillator...

    Until you consult your Datasheet, you don't know where the MCLR pin is, or what to do with it or how to disable it...

    Until you consult the Datasheet, you don't know what pins have bi-directional I/O and what pins haven't, what pins have other functions multiplexed with them, and how to enable or disable those functions, or how to use them.

    Until you consult the Datasheet, you don't realise that the 877A (keeping the thread in-topic) has COMPARATORS and a VOLTAGE-REFERENCE MODULE stuffed inside whilst the plain 877 hasn't - and how to recognise if the PIC on your desk can actually perform to do the task you're giving it, or if you should have bought a different variant.

    So tell me - how are you going to discover those features UNLESS you READ the Datasheet? Crystal Ball? Telepathy? Oh... I forgot, of course - go the Datasheet substitute route and ask the forum!

    C'mon, are you seriously suggesting that all the amateurs and hobbyists and students are excused from Datasheets because the experts and professionals - and those that can read - can provide all the answers?

Similar Threads

  1. Send binary file to pic over pc serial port
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 3rd May 2011, 13:47
  2. Replies: 11
    Last Post: - 12th July 2008, 02:36
  3. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 22:35
  4. High Speed Serial Comm PC - PIC and PIC - PIC
    By manumenzella in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 16th January 2007, 21:55
  5. Replies: 5
    Last Post: - 20th March 2006, 01:34

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts