Serin with low voltage


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default Serin with low voltage

    Today I hate the pic more than yesterday, but its my lack of understanding and wanting to move too fast....



    Hardware:

    16f88 @ 4mhz

    Serout on portb.6

    Serin on portb.7 and also tried porta.0

    T610 and a t68i


    I have got working serial out into the mobile phone(s), I have 2 old datacables connected to the PC as com1 and com5, so I can use these cable ends to 'see' whats going on.

    My pic is sending A,T,13 fine, I can see that on com1, the phones output is connected back to the pic and my cable to com5

    I can see the phone responds with A,T,13 then a 10,O,K,13

    So data is going into the phone, and being echoed out, and I'm getting valid responses (2days work this.....)

    Problem is the pic does not seem to 'see' any data back from the phone, even though the max232 connected to windows can see it and is whats expected.

    I tried a simple test like this..

    serout portb.6,t300,["at",13]
    pause 1000
    serout portb.6,t300,["at",13]
    pause 1000

    ' Send AT twice so phone can auto set baud rate
    ml:

    serin porta.0,n300,buf ' wait for anything from phone

    toggle portb.5 ' signal something happening
    pause 10
    goto ml


    I run the above program, I can see AT on com1 and AT OK on com5, so data was sent and phone replied, then nothing, good so far...

    Now it should be at the serin command, so I call the phone, it sends out the word ''RING'', which I see on com5, so phone is sending data, but the serin command just sits and does nothing............



    I have tried various settings on serin, ie N, ON, T, OT, they either dont work at all, or the LED flashes all the time.


    I think the voltage from the phone (about 3.5) is too low for it to work, but I would have thought that anything above nearly 0 would count as a 1.

    If you set portb to input and just run your finger near the pins you get enough noise for it to see a logic 1


    Should I be looking at boosting the voltage into the pin?

    I have tried a 1k pull up, and even 1k pulldown, no change.

    Tried an led and resistor so I can physically see the data (well its 300 baud you can 'see' it), so I know that with no data the pin is 'high' (led lit) and when the 'ring' event occurs the led goes dim


    I have seen people use a max232 from the pic, then put that into another max232 back down to the phone, seems a bit of over engineering but if thats what it takes etc.......
    Last edited by f_lez; - 20th August 2006 at 23:00.

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


    Did you find this post helpful? Yes | No

    Default

    http://www.picbasic.co.uk/forum/show...57&postcount=6

    Also, you have a free USART in your PIC, you should use it. HSEROUT, HSERIN instead. But you have to use the dedicated pins PORTB.2 and PORTB.5
    Steve

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

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    http://www.picbasic.co.uk/forum/show...57&postcount=6

    Also, you have a free USART in your PIC, you should use it. HSEROUT, HSERIN instead. But you have to use the dedicated pins PORTB.2 and PORTB.5
    Yes I've just never used the hardware one before, and never had problems with the serial one before, and I have all the analog side switched off, and it wont even work on purely portb


    I'm going to drag out the scope later and see just whats going in, no reason exists for it not to work, except voltage, so its annoying me now!

    if the damn thing had worked like I guessed it would(!) I would be sat back woth a working toy now!

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    http://www.picbasic.co.uk/forum/show...57&postcount=6

    Also, you have a free USART in your PIC, you should use it. HSEROUT, HSERIN instead. But you have to use the dedicated pins PORTB.2 and PORTB.5


    lol

    I really do have code blindness.........

    I owe you a great thankyou, or apology for disbelief, but even though I had included lines to switch off the analog stuff I had one with a little mistake in it, and I had looked at it at least a 100 times as I scrolled down to where I thought the fault was................

    The 'thing' now works a treat, and I have real data going back in on porta, now to shift it to port b......

    (edit)
    I have moved the code to port b, and it now works, which explains nothing, as even with analog enabled on port A, port B should work just the same! agh!
    Last edited by f_lez; - 21st August 2006 at 14:05.

Similar Threads

  1. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  2. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  3. Help with final project
    By OvERKiLL in forum General
    Replies: 4
    Last Post: - 15th December 2006, 20:35
  4. 4-line LCD Help - using PortA instead of B
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 31st March 2005, 03:14
  5. Low Voltage Detection
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th January 2005, 18:29

Members who have read this thread : 1

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