12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Probably a good idea to use the resistor, on both pins 2 and 3.

    Next... Some flow control.
    What happens if you do not send data? _____________
    There is a TIME OUT/ LABEL thing that goes with SERIN2 just for that.

    Write a sub routine to indicate that data has not been received. Make it short, could be missing data while in the sub routine.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Mmm, interesting.....!

    More reading / GQQGLING for me.

    Quick question, we set the mode to 16780 (2400 baud inverted). Does this in tern automatically set the FlowPin to the correct enabled state? 'This enabled state is determined by the polarity of the data specified by mode' (from the manual).

    Also what's a reasonable 'Timeout' period in milliseconds for this?

    I'll pick up a couple of resistors in the morning.

    See you tomorrow.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Yes, the FLOW PIN is automatically taken care of if used, but we do not need it for what we are doing. It is an option only.
    Also what's a reasonable 'Timeout' period in milliseconds for this?
    That depends on the whole setup for what you intend to do. For these test with keyboard/PC entry 500+ might be a good place to start. If you are connected to something like a GPS that continuously sends data and depending on what else the program does 100 may be what works.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Quick question. What happens to the value of TOTAL at it's memory location after it's sent serially?
    Does the memory location automatically get reset to zero or does the value TOTAL stay there until over-written
    by the next TOTAL value to be sent?

    Code:
    SEROUT2 PORTC.3, 16780, [DEC TOTAL, 10, 13]
    Dave

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


    Did you find this post helpful? Yes | No

    Default

    It stays until over-written or power down.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    I expect you can hear the cogs grinding from where you are today

    Here's what I'm thinking:

    Code:
    Timeout con 500
     
    MAIN:
    PAUSE 250
    
    SERIN2 PORTC.5, 16780, [WAIT ("#"),DEC NUM1,Timeout,Data_Not_Sent,]
    I've made Timeout a CONSTANT 500. Then the program goes to the LABEL Data_Not_Sent. This is were I'm struggling in that I need to be able to tell if the data has been sent. If TOTAL did reset to zero when data was sent I could have used that but it doesn't and it could have just sent to nought's so that would be no good for a handle anyway. Then I though I could 'read' the PIN PORTC.3 to see if that had changed state, again that's only 50-50 that it has from HO to Low and also it could have just sent two zero's which would show no change.

    So I'm looking for something to show a change or changed state when data is sent (I think).

    Am I hot or cold in that last assumption?

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Code:
    SERIN2 PORTC.5, 16780,Timeout,Data_Not_Sent,[WAIT ("#"),DEC NUM1]
    The SERIN2 command looks for the change of state, when using RF the time out thing does not work very well because of noise. The state is always changing even if data is not being sent.
    Last edited by mackrackit; - 15th April 2010 at 15:42.
    Dave
    Always wear safety glasses while programming.

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