converting programs~


Closed Thread
Results 1 to 28 of 28
  1. #1
    Join Date
    Jul 2007
    Posts
    15

    Unhappy converting programs~

    attached along with this msg is a PIC16F877A program.
    It is bio-related program for a hospital.
    Brief description
    Patient in hospital may suffer from slp walking disorder.
    So this program is for an alarm to be raised when the pressure in the shoe increases(when the patient walks, in other words, there is pressure sensor at the shoe sole.)

    Can anyone help convert it for use in PIC 18F4520/18F4420?
    Attached Files Attached Files

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanguine View Post
    attached along with this msg is a PIC16F877A program.
    It is bio-related program for a hospital.
    Brief description
    Patient in hospital may suffer from slp walking disorder.
    So this program is for an alarm to be raised when the pressure in the shoe increases(when the patient walks, in other words, there is pressure sensor at the shoe sole.)
    Can anyone help convert it for use in PIC 18F4520/18F4420?
    I'm sure a lot of people could help with that. The program looks very simple.
    Questions is...can you answer any of the questions in the other thread about the '442?
    AND, how willing are you to try and learn to do the programming yourself vs. somebody else completely rewriting the code for you.

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


    Did you find this post helpful? Yes | No

    Default

    This assumes that the patient is going to put on shoes or slippers before they sleep-walk. They don't... they go wandering in bare feet...

    The best method is for the patient to wear a wrist ID (of the kind they already fit in hospitals) with a proximity alarm tag (similar to the sort they have in stores to prevent you from stealing merchandise). The alarm is sounded as soon as they go through the main door out of their room or hospital ward. This also allows for the patient to get up normally and go to the bathroom without sounding an alarm (nobody sleepwalking as yet has flushed themselves down a toilet!).

  4. #4
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Red face

    yes ill reply to that previous thread.
    And true, of course i'm very fine with learning it all over, converting myself~
    but the thing is if i were to convert myself, i at least will need to know what the program is about. You see, we are given this program coded in PIC 16 and all i need to do is to copy paste into the MPLAB, load into the ICD and thn get it running. But since we need to convert the codes due to the availability of PIC 18, i'll need at least someone to help me get started.
    I'm not writing a program myself in this case, i'm given a program written by someone else and i really just need someone to tell me what the various codes mean and then try to make appropriate amendments.
    not really looking for people to spoon feed me~

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanguine View Post
    not really looking for people to spoon feed me~
    Quite frankly, that's exactly what it looks like...
    What were you planning on doing this in? assembly? PBP? C?

  6. #6
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    ah well...my bad..=X
    It's done in MPLAB IDE

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanguine View Post
    ah well...my bad..=X
    It's done in MPLAB IDE
    There ya go...all converted for an 18F4520 and everything...
    Attached Files Attached Files

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    There ya go...all converted for an 18F4520 and everything...
    Really?

    So on a 18F4520, PORTA is at address 0x05 ?

    .
    DT

  9. #9
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    the program don't look any difference to me other then the changing the PIC16F877A to PIC 18F4520.

    T.T

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanguine View Post
    the program don't look any difference to me other then the changing the PIC16F877A to PIC 18F4520.

    T.T
    What did you expect? You said you didn't want to be spoon fed information!!!

    Look at the program you posted in post #1... Really look at it...
    What's in there? A few defines, a bunch of data blocks, a bunch of loops, and a main loop with some calls to the loops and some delays in it.

    Again, you don't want to be spoon fed, so that's as far as I'm going...

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Really?
    So on a 18F4520, PORTA is at address 0x05 ?
    .
    I know that...but the O/P doesn't want to be spoon fed, so I figured he/she might be able to find that tidbit in the datasheets.

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


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by Melanie View Post
    This assumes that the patient is going to put on shoes or slippers before they sleep-walk. They don't... they go wandering in bare feet...

    The best method is for the patient to wear a wrist ID (of the kind they already fit in hospitals) with a proximity alarm tag (similar to the sort they have in stores to prevent you from stealing merchandise). The alarm is sounded as soon as they go through the main door out of their room or hospital ward. This also allows for the patient to get up normally and go to the bathroom without sounding an alarm (nobody sleepwalking as yet has flushed themselves down a toilet!).
    Too true. An RFID wrist tag is common place in many nursing homes and hospitals to aid with wandering residents, sadly some with Alzheimer's. In my last job I was employed as a field / bench technician to install and service a wireless nurse call system operating on 27 and 304MHz. Top system. I worked with RFID-based wrist tags, door alarms, pressure sensors, displays, repeaters, dialers. Depressing job.

  13. #13
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    I know that...but the O/P doesn't want to be spoon fed, so I figured he/she might be able to find that tidbit in the datasheets.
    yea...i DUN want to be spoon fed but that much of information i manage to think of myself. By the way, I'm learning to use a pic16F877 now since my lecturer got me one. Learning the MPLAB IDE ver 7.50.
    AND SKIMASK.. im a 18 yr girl who is an extreme noob in programming.
    I'm only taught for 1-3 month for my MCT module?
    I dun think i can be as pro as you are...if not i would'nt have asked for help here! if that is spoon feeding to you then be it. I'm very fine with it.

  14. #14
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanguine View Post
    yea...i DUN want to be spoon fed but that much of information i manage to think of myself. By the way, I'm learning to use a pic16F877 now since my lecturer got me one.
    Which is a fair distance from a PIC18F442/452...

    Learning the MPLAB IDE ver 7.50.
    Also outdated, latest version is 7.61 (maybe 7.62 by now)

    im a 18 yr girl
    Don't matter...

    who is an extreme noob in programming.
    Then pick up an 'extreme noob' type project and work your way up.

    I dun think i can be as pro as you are...
    Time will tell now won't it...

    if not i would'nt have asked for help here! if that is spoon feeding to you then be it. I'm very fine with it.
    Good, because I haven't seen anything that you have written yet...just copies of stuff you want converted.
    Show us something that YOU have written, and when it doesn't work, ask the question Why...
    Last edited by skimask; - 12th July 2007 at 15:47.

  15. #15
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    oh..i would not have choose such a difficult proj (but i noob) if i have a choice..
    I was GIVEN it.
    and ya...i'll try to learn and if there is still qn I'll ask WHY.
    n for ur information, i tell u im a girl so u dun have to say he/she.
    geezz..

  16. #16
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanguine View Post
    oh..i would not have choose such a difficult proj (but i noob) if i have a choice..
    I was GIVEN it.
    and ya...i'll try to learn and if there is still qn I'll ask WHY.
    n for ur information, i tell u im a girl so u dun have to say he/she.
    geezz..
    You were GIVEN this? As a first project or what?
    Elaborate a bit on what the code is supposed to accomplish...I know you said it's for sleeping walking/pressure sensor/whatever...
    What does the circuit this is connected to look like?

  17. #17
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    YES!!
    oh my..do u thing I'm so crazy as to start of learning mct by trying to convert other people program? That will be like learning to run before i know how to walk.
    this is my first project in mct..it's also my final year project!
    u want the proj brief? hah..i'll tell u.

    some patients do slp walk
    so this particular hospital wants us to make the sole of the shoe with sensors.
    Once the pressure increases by the walking patient, the buzzer will sound.
    This is what the program does, it processes the reading then decide if it wants to raise an alarm..

    I don't have any "look like" picture for you

  18. #18
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanguine View Post
    YES!! oh my..do u thing I'm so crazy as to start of learning mct by trying to convert other people program? That will be like learning to run before i know how to walk. this is my first project in mct
    MCT = ???

    ..it's also my final year project!
    I hope you didn't pay good money for that course... How many years do you have to go thru to get to a 'final year' anyways?

    some patients do slp walk... so this particular hospital wants us to make the sole of the shoe with sensors. Once the pressure increases by the walking patient, the buzzer will sound. This is what the program does, it processes the reading then decide if it wants to raise an alarm..
    You mean just like you wrote in post #1?
    So far, all you've done is describe what you want the end result will be.
    What kind of sensors do you plan on using? How do you plan on reading those sensors?
    Ok, you'll use a PIC16F877A... Are you planning on using straight assembly in MPLAB IDE to program this?
    What do you know about programming in general? Assembly? PICs? Electronics?

  19. #19
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    MCT = ???
    microcontroller technology

    I hope you didn't pay good money for that course... How many years do you have to go thru to get to a 'final year' anyways?
    lots of money...have you heard of POLYTECHNICS IN SINGAPORE?
    yea..im in one of them. 3 yrs course, but they teach u different modules regarding ur course. graduation ends with exam n a final year project.

    You mean just like you wrote in post #1?
    So far, all you've done is describe what you want the end result will be.
    What kind of sensors do you plan on using? How do you plan on reading those sensors?
    Ok, you'll use a PIC16F877A... Are you planning on using straight assembly in MPLAB IDE to program this?
    What do you know about programming in general? Assembly? PICs? Electronics?
    yes...i meant that. The sensor part will be briefed by the lecturer in the later part. We have to get the program working first! yea..i thought of using MPLAB because im ONLY taught that and moreover the syllabus only requires us to learn PIC18F452 and basic programming like displaying msg on LCD screen. they DON"Y teach us anything else..other PICs or what..nothing

  20. #20
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanguine View Post
    lots of money...have you heard of POLYTECHNICS IN SINGAPORE?
    Should I have?

    Sounds to me like you should first learn how to make the standard 'blinky LED' type project and work your way up to your 'final project'.

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


    Did you find this post helpful? Yes | No

    Default

    What Skimask mean between the line (or colon), is that YES we can help you, but you'll need to tell us a little bit more about what you already find/tested. Sensor, , additional hardware, links, datasheet, method etc etc.
    Steve

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

  22. #22
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    What Skimask mean between the line (or colon), is that YES we can help you, but you'll need to tell us a little bit more about what you already find/tested. Sensor, , additional hardware, links, datasheet, method etc etc.
    Yep...what him said...
    (colon.........Oh you're a riot nowadays!!! )

  23. #23
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi sanquine,

    I replied earlier this morning about the same thing that Melanie did but for some reason it didn't get posted.

    Stop for a minute and re-read what you have posted here. You want to know when a sleep walker gets up and starts walking around. You are wanting to put sensors on the patients shoes or slippers. Like Melanie stated, most sleep walkers just get up and start walking. I think you are over complicating things here.

    I think all you need are a couple of pressure mats placed on each side of the bed connected to a simple sounder circuit or even something like a 555 timer. You could even put an opening sensor on the door into the patient's room with a pressure pad inside the door and using a 555 timer, when the patient steps on the mat it enables the 555 timer to operate as soon as the door is opened. This configuration would not sound if the door is opened first such as when the nurse comes in to check on the patient. If you are hell bent on using a PIC then something like the 12F chips could be used instead of the 555 timer. Yea I remember from one of your posts that you need to use a 18F452 but they gave you an 16F877A. Well you can use that in place of the 555 or 12F PIC. Fancy up the project once you have the basics working by adding flashing lights outside the patient' s room or have a LCD display with alerting beeper at the nurse's station display something like "Mr Smith is sleep walking again!"

    What you are asking for or being asked to do isn't difficult to do, but to put sensors on a patient's shoes is a big waste of time.

    I have in the past two years provided numerous solutions for my biggest security client. The last project was for unassisted apartment dwellers on this retirement campus that are in the beginning stages of dementia but not quite ready for the full assistance package. The apartments already have alarm dialers for the emergency cords and smoke detectors. We put together a PIC controlled clock that enables a wireless door transmitter between 10pm and 7am. If the person leaves during these hours, then security personnel go and check on them. While one person is responding, another person is monitoring the 4 main exits on the video system to see if they leave the building before help arrives. The PIC controlled clock is not affected by the spring and fall time change and needs a new backup battery every 5 years. Works great and all we need the patient to do is walk out the door. No shoes? No problem.

    Take your project in small steps then build it up to the grand finale!

    Sure hope this helps you in some way.

    By the way, I noticed that you wanted to do your project in assembly. This forum is for people using PICBasic and PICBasic Pro. You might want to look over the software most of us use here and switch to this because your developement time will be alot shorter.

    Good luck!

    BobK

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


    Did you find this post helpful? Yes | No

    Default

    I think in some instances students are given a task by a lecturer and are expected to run with the assigned project (whether it's a good idea or not is irrelevant). The lecturer is looking to see how each student will cope with the assignment.

  25. #25
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    THX BOB~
    =)
    yea..i know...would not want to have complicated things but its just that, as melanie said, its an assignment given to us. The teacher does not expect us to tell him there might be another better choice in this or that way.
    He just want us to do what he ask for and give us the grades.
    Anyway, i'm trying~
    And i'm really thankful for the concern and suggestion that i've received!

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


    Did you find this post helpful? Yes | No

    Default

    As my grandfather always said to me; don't do as I do - do as I bloody say.

  27. #27
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    I think in some instances students are given a task by a lecturer and are expected to run with the assigned project (whether it's a good idea or not is irrelevant). The lecturer is looking to see how each student will cope with the assignment.
    I think Melanie has correctly assessed the situation; I'm sorry that skimask wasn't a little gentler.

    A young friend of mine (he's about 35 now) went to a private (expensive) tech school about 10 or 12 years ago. In one class they were divided into teams and each team was challenged, in addition to regular course work, to design and specify a portable scoreboard for Pop Warner football ("American football"; Pop Warner is the football equivalent to Little League baseball). At the time of the assignment, no student had any experience in specification, nor in microprocessors. They had learned basic digital, discrete analog, and op amps. As Melanie said, they had to "run with it". Anyway, his team needed a simple, reliable clock signal source, so he called me for ideas. I showed them how to do it with a couple of buffer gates and a crystal. (The teacher told them it wouldn't work. I breadboarded it and brought it to his class. Yes, it worked--just not a circuit you find in the textbooks!)

    Sanguine, just keep at it. Don't let the naysayers get you down. We were all once newbies!
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  28. #28
    Join Date
    Jul 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    oh..thank you RussMartin..
    I'm alright with skimask actually, its just that i was quite unused to the way he say things. I just felt like he wasn't trying to understand my situation.
    I really would have prefered things where i get to start at more basic things.
    But anyway, i'm still browsing through the net n see if i can more information regarding my project. I have met many helpful people so far and its kind of more encouraging.
    i'll work harder~

Similar Threads

  1. Help converting DS1993 to DS2433+
    By isaac in forum General
    Replies: 0
    Last Post: - 29th August 2008, 14:34
  2. Replies: 5
    Last Post: - 26th March 2006, 19:26
  3. Converting Stamp code
    By paul.mcallister in forum General
    Replies: 1
    Last Post: - 8th February 2005, 11:48
  4. converting long integer
    By jra in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th September 2004, 17:02
  5. Need help converting to PB Pro from Mbasic Pro
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 11th February 2004, 07:43

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