URGENT help on PIC16F1827
Moderator: Benj
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
Hi Martin\
You are 100 % right it is RA3 I don't know how I pick up RA6 in my drawing.
I double checked and it is RA3
My apologies. I posted the wrong image before. I had the right thought but not the correct images.
So we now are on the right path. Thank you
You are 100 % right it is RA3 I don't know how I pick up RA6 in my drawing.
I double checked and it is RA3
My apologies. I posted the wrong image before. I had the right thought but not the correct images.
So we now are on the right path. Thank you
- Attachments
-
- RA3.jpg (8.54 KiB) Viewed 11801 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: URGENT help on PIC16F1827
Hi Just started modifying your Flowchart.
I would recommend not sharing RS232 with other outputs.
Perhaps you would like choose another pin?
Martin
Only problem is within Ball_Dispaly macro for example you're using RA1 when Ball = 2JLeith wrote:Martin can I use ( RA1 ) it looks to be the same as (RA0) ?
I would recommend not sharing RS232 with other outputs.
Perhaps you would like choose another pin?
Martin
Martin
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
Hello Martin,
My mess.
On Ball macro yes there is ( A1 ) ( A2) ( A3 ). And any other A? can be removed.
A1 -- 2 -- 3) I was using them to follow the action to see if I ever entered the Ball 2 and three.
Only RA 0 in use is RA 0 for control of the Bank Selection
Only RA 4 is used for Pulse length timing. When the RC timing is running it send the result to RA0 and stops the +12 going out to the Segments.
I was not sure if could use locked in delays for RA 0 for 250 msec or keep with the original design for the RC on RA 4.
Martin you will see that I added 2 sec delays in the Ball Macro to aid in me seeing the ON segment being produced on the VANS. Martin is there a better way to list the delays say in a Macro and when the time comes and I can shorten I could address 1 spot.
I worry when I go into the other Macros and add the 2 sec delays I will run out of CHIP memory ??
Martin if you can see ways to improve please indulge I have nothing to loose.
John
My mess.
On Ball macro yes there is ( A1 ) ( A2) ( A3 ). And any other A? can be removed.
A1 -- 2 -- 3) I was using them to follow the action to see if I ever entered the Ball 2 and three.
Only RA 0 in use is RA 0 for control of the Bank Selection
Only RA 4 is used for Pulse length timing. When the RC timing is running it send the result to RA0 and stops the +12 going out to the Segments.
I was not sure if could use locked in delays for RA 0 for 250 msec or keep with the original design for the RC on RA 4.
Martin you will see that I added 2 sec delays in the Ball Macro to aid in me seeing the ON segment being produced on the VANS. Martin is there a better way to list the delays say in a Macro and when the time comes and I can shorten I could address 1 spot.
I worry when I go into the other Macros and add the 2 sec delays I will run out of CHIP memory ??
Martin if you can see ways to improve please indulge I have nothing to loose.
John
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: URGENT help on PIC16F1827
What I would do, is instead of a fixed constant for delays (e.g 2 sec Delay)JLeith wrote:Martin is there a better way to list the delays say in a Macro and when the time comes and I can shorten I could address 1 spot.
Use a variable int for delay and set delay for milliseconds.
At the start of Main you can assign variable with how many milliseconds you want delay to last for.
E.g
Code: Select all
Time_Delay = 2000
Martin
Martin
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
Thank you Martin,
I was sure there must be a better way to address the Timing. Excellent knowledge.
Yes you might find the RA settings in some of the other and they were just to give me a glimmer in how this mystery PIC works or in my case not work.
I really appreciate your time and energy.
Martin as I was typing this message and I'm a 2 finger typer the cable has arrived.
ODD there is no manual with it ???
Color wires are ( White ) (Red) ( Green ) ( Black )
John
I was sure there must be a better way to address the Timing. Excellent knowledge.
Yes you might find the RA settings in some of the other and they were just to give me a glimmer in how this mystery PIC works or in my case not work.
I really appreciate your time and energy.
Martin as I was typing this message and I'm a 2 finger typer the cable has arrived.
ODD there is no manual with it ???
Color wires are ( White ) (Red) ( Green ) ( Black )
John
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
I think I found the wire label.
Do you think this is correct
RED = 5 Volts
Black = GRD
White = RXD
Grenn - TXD
Now in our case we will be using
RED - connect to 5 Volts
Black - connect to GRD
Green - for TXD to the USB connected to the Laptop
John
Do you think this is correct
RED = 5 Volts
Black = GRD
White = RXD
Grenn - TXD
Now in our case we will be using
RED - connect to 5 Volts
Black - connect to GRD
Green - for TXD to the USB connected to the Laptop
John
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: URGENT help on PIC16F1827
Your welcome John.
Not using any other colours.
White is because Host TTL to USB adaptor is plugged into is Receiving RS233 (not transmitting)
Did you receive a drivers disk as well for TTL to usb adaptor?
I noticed timer0 Interrupt is using RA1, I assumed this is not required as well?
I need to stop for the night (Now 23:44 in the UK), will PM you flowchart tomorrow along with hex file when I get home from work.
I can then help you set up laptop to display all your variables.
You can even capture a log of the variables and work out what the issue is (hopefully )
You will be using Black for GND and White RA1JLeith wrote:Color wires are ( White ) (Red) ( Green ) ( Black )
Not using any other colours.
White is because Host TTL to USB adaptor is plugged into is Receiving RS233 (not transmitting)
Did you receive a drivers disk as well for TTL to usb adaptor?
I noticed timer0 Interrupt is using RA1, I assumed this is not required as well?
I need to stop for the night (Now 23:44 in the UK), will PM you flowchart tomorrow along with hex file when I get home from work.
I can then help you set up laptop to display all your variables.
You can even capture a log of the variables and work out what the issue is (hopefully )
Martin
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: URGENT help on PIC16F1827
John,
I would not connect the 5V to your circuit. It is usually an output from the PC (the USB bus carries 5V to power devices) and you project has its own power. If you have a multi meter available you check it there is a voltage if you just connect the USB plug to you computer and nothing (besides the multi meter) to the wires.
Jac
I would not connect the 5V to your circuit. It is usually an output from the PC (the USB bus carries 5V to power devices) and you project has its own power. If you have a multi meter available you check it there is a voltage if you just connect the USB plug to you computer and nothing (besides the multi meter) to the wires.
Jac
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
Evening Martin
Yes it getting late for you. I forget the time difference I'm off tonight to Umpire a Baseball game.
I think the RA1 in the timer0 is not needed.
Is there going to be light at the end of the tunnel.
Talk to you tomorrow.
If it is easier I could call you on the telephone. Just not sure when you get home.
If you think this would be easier to talk on the phone send me your telephone number.
John
Yes it getting late for you. I forget the time difference I'm off tonight to Umpire a Baseball game.
I will solder in the connects tomorrow morning.You will be using Black for GND and White RA1
I think the RA1 in the timer0 is not needed.
No driver disk. I will check with the supplier maybe it is a stand alone download.Did you receive a drivers disk as well for TTL to usb adaptor?
Is there going to be light at the end of the tunnel.
Talk to you tomorrow.
If it is easier I could call you on the telephone. Just not sure when you get home.
If you think this would be easier to talk on the phone send me your telephone number.
John
-
- Posts: 243
- Joined: Tue Nov 27, 2012 12:53 pm
- Location: Cambridge, UK
- Has thanked: 140 times
- Been thanked: 118 times
- Contact:
Re: URGENT help on PIC16F1827
Hi John.
I had a little more time to review your code and I think I discovered a possible problem.
When you first start the code, Port B is initialised as an input and awaits button press. However, after executing the Ball function, the loop does not expressly return Port B to an input in preparation for the next button read. Flowcode responds by assuming that the switch in the IDE is directly connected to the port but, in reality, if the multiplexed port remains an output immediately prior to a read then the switch may well not be able to overcome preloaded line capacitance via the resistors connecting the switches to Port B.
All the best,
Brendan
I had a little more time to review your code and I think I discovered a possible problem.
When you first start the code, Port B is initialised as an input and awaits button press. However, after executing the Ball function, the loop does not expressly return Port B to an input in preparation for the next button read. Flowcode responds by assuming that the switch in the IDE is directly connected to the port but, in reality, if the multiplexed port remains an output immediately prior to a read then the switch may well not be able to overcome preloaded line capacitance via the resistors connecting the switches to Port B.
All the best,
Brendan
Last edited by Brendan on Sat May 11, 2013 6:10 pm, edited 2 times in total.
LinkedIn Profile...
http://www.linkedin.com/in/brendantownsend
http://www.linkedin.com/in/brendantownsend
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: URGENT help on PIC16F1827
Hi John.
Just been randomly activating switches.
This is what was displayed: To set up Hyperterminal:
First you need to establish what com port TTL to USB converter is using.
With Vista and windows7 I just clicked on Start, Computer, System Properties (From top menu. You can also run device manager from control panel) , Device manager.
In device manager expand: Ports (COM & LPT) by clicking on it.
The Com port TTL to USB converter should now be shown (make a note of it).
Close Device manager and now run Hyperterminal and enter a name for your new connection.
When OK is selected, you should see correct port displayed in Connect using: box. if its wrong then select correct port, then OK.
Just change Flow control to None.
You should have:
Bits per second:2400
Data bits:8
Parity: None
Stop bits:1
Flow control: None
With all the switches off you should get real time elapsed in seconds.
You will be notified if program is resetting, also clear from runtime displayed in seconds (1 to 32767)
Would you like both files pm'd or just post on here?
Martin
Edit: Just corrected Gust to Guest
Just been randomly activating switches.
This is what was displayed: To set up Hyperterminal:
First you need to establish what com port TTL to USB converter is using.
With Vista and windows7 I just clicked on Start, Computer, System Properties (From top menu. You can also run device manager from control panel) , Device manager.
In device manager expand: Ports (COM & LPT) by clicking on it.
The Com port TTL to USB converter should now be shown (make a note of it).
Close Device manager and now run Hyperterminal and enter a name for your new connection.
When OK is selected, you should see correct port displayed in Connect using: box. if its wrong then select correct port, then OK.
Just change Flow control to None.
You should have:
Bits per second:2400
Data bits:8
Parity: None
Stop bits:1
Flow control: None
With all the switches off you should get real time elapsed in seconds.
You will be notified if program is resetting, also clear from runtime displayed in seconds (1 to 32767)
Would you like both files pm'd or just post on here?
Martin
Edit: Just corrected Gust to Guest
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: URGENT help on PIC16F1827
Drivers need to create a VCP (Virtual Com Port)
I have two TTL to USB converters here.
One shows this: The other TTL to USB shows this: Is sounds to me like either correct drivers for your device are not installed or the VCP part is not installed?
I have two TTL to USB converters here.
One shows this: The other TTL to USB shows this: Is sounds to me like either correct drivers for your device are not installed or the VCP part is not installed?
Martin
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
Agree I think I have to remove some memory on the laptop.
Why is the world of laptops so hard some times
Why is the world of laptops so hard some times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: URGENT help on PIC16F1827
I just think you have been sent the wrong drivers?
I will have a search.
I will have a search.
Martin
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
I have the Prolfic USB to Serial Comm Port ( Com4 ) under Ports (Com & LPT )
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
I have set the Speed to 2400
Now it says com4 is that the USB port ?
Ok now what is my next step
John
Now it says com4 is that the USB port ?
Ok now what is my next step
John
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: URGENT help on PIC16F1827
Thats Great!
So the web site I pm'd to you that contained drivers was correct
You need to follow what I posted about setting up hyperterminal with Connect using: set at Com4
Next you need to load attached hex file into your programmer and program 16F1827
Connect Black lead to GND and RXD (White) to Port A1
If all is working, you should see text and values within hyperterminal window,
So the web site I pm'd to you that contained drivers was correct
You need to follow what I posted about setting up hyperterminal with Connect using: set at Com4
Next you need to load attached hex file into your programmer and program 16F1827
Connect Black lead to GND and RXD (White) to Port A1
If all is working, you should see text and values within hyperterminal window,
Martin
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: URGENT help on PIC16F1827
Excellent.
I loaded the Martin Hex into the chip.
Loaded by PICKIT 2.
Martin if I load the FLOWCODE will it work with my Home version and load the PIC ??
Odd when I powered it up the new LED did not come on ??
Now the laptop is in the basement and my main PC is on the top floor.
off to see what the laptop tells me.
Back soon.
I loaded the Martin Hex into the chip.
Loaded by PICKIT 2.
Martin if I load the FLOWCODE will it work with my Home version and load the PIC ??
Odd when I powered it up the new LED did not come on ??
Now the laptop is in the basement and my main PC is on the top floor.
off to see what the laptop tells me.
Back soon.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: URGENT help on PIC16F1827
The only thing you can do with the Flowchart is run a simulation. If you try to compile to hex or target, then I would assume you will get some error or warning associated with RS232.JLeith wrote:Martin if I load the FLOWCODE will it work with my Home version and load the PIC ??
LED connected to Port A3 is flashing for me on my hardware,JLeith wrote:Odd when I powered it up the new LED did not come on ??
Well solid for the first 5 seconds, then flash every second.
Martin