Will I EVER get serial communication working ?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2009
    Posts
    21

    Default Will I EVER get serial communication working ?

    Earlier this year I spent hours unsuccesfully trying to operate a serial lcd with no success at all & assuming it was a dud lcd I gave up.
    I now need to cotrol a quadravox sound module with serial data and once again I simply cannoy get the darned thing working. The module requires a number between 0 and 239 to identify an mp3 track. I have recorded two tracks (00 and 01) and the software provided by quadrovox for testin shows that they are there and play OK. I have now connected a PIC 1628a running at 4 mhz (crystal)
    checked that it is working by writing a prog to blink an led on PortB.3 So far so good. I have now connected PortB.0 to the serial port of the module (pin 2 data receive and pin 5 ground) and having been told to muse driven inverted output have written the following program which compiles Ok but does absolutely zilch. What the devil am I doing wrong !!! If I go on like tyhis much longer matron's not going to let me out. Any helpful suggestions would be greatly appreciated
    [
    @device PIC16F628A
    include "modedefs.bas"
    DEFINE OSC 4
    x VAR BYTE
    loop:
    pause 2000
    for x= 0 to1
    SEROUT Portb.3,n9600,[x]
    pause 4000
    next x
    goto loop
    end
    ]

  2. #2
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Will I EVER get serial communication working ?

    Try with max232 and mode T9600.
    Also check if pin 2 is an input... If you use same cable as for PC port, then your Tx should be same as on PC, pin 3.
    If you trying to send data to PC, then you should connect portb.0 to PC pin 2...

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Will I EVER get serial communication working ?

    Read about CCP1CON, section 9 of the data sheet. Turn it off.

    9600 baud can be too fast for 4MHz.

    For testing try sending a string to a terminal. MCS has one built in.

    Use SEROUT2 with an inverted mode less than 9600. No MAX232 required for this test.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default Re: Will I EVER get serial communication working ?

    it's been said countless time here (and probably the manual state it too) SEROUT/SEROUT2 @ 9600 bauds & @ 4mhz aren't going to work accurately.. worst when using an old PIC model AND it's internal OSC.

    Your best bet it at least to use the internal USART (with the according dedicated pins & hardware + DEFINEs) OR worst case use DEBUG.
    Steve

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

  5. #5
    simonr's Avatar
    simonr Guest


    Did you find this post helpful? Yes | No

    Default Re: Will I EVER get serial communication working ?

    Did you ever get the sound module to work? I've used them at 2400 baud (BR1 and BR0 low) without too many problems. It is important to check the that the module isn't busy (pin 3 on the module isn't low) before sending commands e.g:

    loop:
    if busy=0 then loop 'check module

    SEROUT RXD,0,[$FC,62] 'set volume
    SEROUT RXD,0,[0] 'play file

    Also, are you sending data to pin 2 of of the module, as this is the module transmit pin and not the receive pin?

    It is also a good idea to set the volume, as I have played files with no O/P only to find that the volume was set too low!

    The only problem that I have with the module is that they draw 10mA when not in use and when I put in sleep mode (Of8h) I can't wake it up again!

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