Like to read Port B then send to Port D
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: Like to read Port B then send to Port D
Correct the LED wiring
Still just get BLACK squares
Still just get BLACK squares
- Attachments
-
- LED2.jpg (19.65 KiB) Viewed 13980 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: Like to read Port B then send to Port D
Row of black squares is either uninitalised because of wrong or poor connections or connecting LCD after target device has been powered up.
Contrast could be a bit too high.
If far two high then you will get two rows of black squares.
Make sure all connections are correct(including R/W to GND)
Make sure itself that contrast controls does change contrast ok.
Check on the contrast voltage on LCD itself covers the full range.
Contrast could be a bit too high.
If far two high then you will get two rows of black squares.
Make sure all connections are correct(including R/W to GND)
Make sure itself that contrast controls does change contrast ok.
Check on the contrast voltage on LCD itself covers the full range.
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: Like to read Port B then send to Port D
Still working on the LCD.
I double checked and the wiring looks good.
I think I will do away with the jumper leads and run wire to the ports. I had this problem once before with the jumper wires causing interference.
I tried a 10K pot to see if it would help but no luck.
Back to triple check the wiring.
John
I double checked and the wiring looks good.
I think I will do away with the jumper leads and run wire to the ports. I had this problem once before with the jumper wires causing interference.
I tried a 10K pot to see if it would help but no luck.
Back to triple check the wiring.
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: Like to read Port B then send to Port D
Hi Martin,
I have searched the internet till my eyes are getting sore.
I was looking at the Flowcode action of the servo's and they work like the breadboard actions other then the LCD.
What I did notice is the PIC and noticed that DATA 3 ( Pin 18 ) RC3 never changes state even when the LCD changes ?
Also RC5 ( Pin 24 ) is the Enable and it never flashes.
John
I have searched the internet till my eyes are getting sore.
I was looking at the Flowcode action of the servo's and they work like the breadboard actions other then the LCD.
What I did notice is the PIC and noticed that DATA 3 ( Pin 18 ) RC3 never changes state even when the LCD changes ?
Also RC5 ( Pin 24 ) is the Enable and it never flashes.
John
- Attachments
-
- LCD3.jpg (48.06 KiB) Viewed 13969 times
- 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: Like to read Port B then send to Port D
It was very surprising that the PIC 16F1937 was causing the problem with the LCD.
Glad we got down to the route of the problem in the end.
What through me was the resistance with LCD disconnected between pin pin12 and grown resistance was lower than it should have been.
You can load the servo test program and watch the LCD change as servo changes.
Changed the PIC and we know have it working
Martin thank you for helping figure it out.
Here is a picture of the now working LCD
John
Glad we got down to the route of the problem in the end.
What through me was the resistance with LCD disconnected between pin pin12 and grown resistance was lower than it should have been.
You can load the servo test program and watch the LCD change as servo changes.
Changed the PIC and we know have it working
Martin thank you for helping figure it out.
Here is a picture of the now working LCD
John
- Attachments
-
- LCD Test.jpg (101.16 KiB) Viewed 13960 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: Like to read Port B then send to Port D
Hi John,
Yes it was an odd fault.
The 16F1937 could not pull down on C1 (Sink) , but could source.
The cause could be trying to pull down a 5V supply?
Anyway as per request via PM, I have guess at what an extra 5 deg would be.
If this don't work, then perhaps the other way would be to use a pot to set the servo.
LCD will display the ADC value of pot so we know what the correct value to use for the servo.
Martin.
Yes it was an odd fault.
The 16F1937 could not pull down on C1 (Sink) , but could source.
The cause could be trying to pull down a 5V supply?
Anyway as per request via PM, I have guess at what an extra 5 deg would be.
If this don't work, then perhaps the other way would be to use a pot to set the servo.
LCD will display the ADC value of pot so we know what the correct value to use for the servo.
Martin.
- Attachments
-
- Servo test2.fcf
- (58.2 KiB) Downloaded 297 times
-
- Servo test2.hex
- (11.12 KiB) Downloaded 289 times
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: Like to read Port B then send to Port D
Thank you
Your help is appreciated beyond the great pond.
John
Your help is appreciated beyond the great pond.
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: Like to read Port B then send to Port D
Hi John,
Your welcome.
Attached is a basic Servo position tester.
Just connect pot center wiper to AN1( pin 3 of 16F1937). via a resistor say 4K7 to 10K,
Purpose of resistor is to protect both microcontroller and pot if pot o/p is say set to 5V and microcontroller that's connected to pot wiper is accidentally set as 0V o/p.
The left pin of pot to ground (so when turned fully ccw there will be 0V across wiper and GND) right side of pin connect to +5V.
Your welcome.
Attached is a basic Servo position tester.
Just connect pot center wiper to AN1( pin 3 of 16F1937). via a resistor say 4K7 to 10K,
Purpose of resistor is to protect both microcontroller and pot if pot o/p is say set to 5V and microcontroller that's connected to pot wiper is accidentally set as 0V o/p.
The left pin of pot to ground (so when turned fully ccw there will be 0V across wiper and GND) right side of pin connect to +5V.
- Attachments
-
- Servo test3.hex
- (10.33 KiB) Downloaded 284 times
-
- Servo test3.fcf
- (11 KiB) Downloaded 284 times
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: Like to read Port B then send to Port D
Great program for setting the Servo
LCD = 1 ( Zero )
LCD = 215 ( 90 Degree )
John
LCD = 1 ( Zero )
LCD = 215 ( 90 Degree )
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: Like to read Port B then send to Port D
Thanks.
At least we know what values to use for the servos now.
I will see if I can put it all together.
The only thing is with the timing diagram is events look like that are occurring simultaneously.
Is that how it's going to be in real life?
At least we know what values to use for the servos now.
I will see if I can put it all together.
The only thing is with the timing diagram is events look like that are occurring simultaneously.
Is that how it's going to be in real life?
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: Like to read Port B then send to Port D
Hi John,
Attached works for me even with portB changing every 1ms
but I'm not using same hardware as you to pull port B and A4 down
Martin
Attached works for me even with portB changing every 1ms
but I'm not using same hardware as you to pull port B and A4 down
Martin
- Attachments
-
- Segment control to Servo v11.hex
- (16.63 KiB) Downloaded 252 times
-
- Segment control to Servo v11a.fcf
- (66.49 KiB) Downloaded 232 times
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: Like to read Port B then send to Port D
Hi Martin
Posting the actions of the New PIC's
Well the new chip is in and the circus must be in town.
Not working or is working to perfect
I have tried setting the PIC16F1827 time delay
From 30 msec to 1000 msec
Nothing I can't get the 1937 to pick up the PortB bits.
The timing around 250 is the best when it only see the ( B ) and not the (C)
The PM is not working
John
Posting the actions of the New PIC's
Well the new chip is in and the circus must be in town.
Not working or is working to perfect
I have tried setting the PIC16F1827 time delay
From 30 msec to 1000 msec
Nothing I can't get the 1937 to pick up the PortB bits.
The timing around 250 is the best when it only see the ( B ) and not the (C)
The PM is not working
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: Like to read Port B then send to Port D
Hi John.
Attached is an improved display version.
You will now know at the start of segment changes, and in idle state what digit or clear board has taken place.
For example while segments are changing: When Idle: &
If clear board: Hope you like the improvements
Martin
Attached is an improved display version.
Since we have established that A3 line on hardware was High when it should have been low, the attached version uses B7 to clear rather than A3JLeith wrote:Nothing I can't get the 1937 to pick up the PortB bits.
You will now know at the start of segment changes, and in idle state what digit or clear board has taken place.
For example while segments are changing: When Idle: &
If clear board: Hope you like the improvements
Martin
- Attachments
-
- Segment control to Servo v29.fcf
- (71.49 KiB) Downloaded 246 times
-
- Segment control to Servo v29.hex
- (18.23 KiB) Downloaded 231 times
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: Like to read Port B then send to Port D
Hi Martin
Version 29 looks like a master chief creation and it looks like a dream is coming true.
Yes the added touch of knowing what digit it is working will make it a lot easier. I did find I had several flipped code on the 1827 for the Inning display
I will let you know how it works in the mystery world across the might pond.
John
Version 29 looks like a master chief creation and it looks like a dream is coming true.
Yes the added touch of knowing what digit it is working will make it a lot easier. I did find I had several flipped code on the 1827 for the Inning display
I will let you know how it works in the mystery world across the might pond.
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: Like to read Port B then send to Port D
Martin do you have a moment to Skype.
Version 29 is having a mild stoke........ Servo and LCD are drumming to a beat.
I would like to show you.
I'm on Skype
John
Version 29 is having a mild stoke........ Servo and LCD are drumming to a beat.
I would like to show you.
I'm on Skype
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: Like to read Port B then send to Port D
Hi John,
At work which is where I modified flowchart, so not tested it on hardware.
Be home at about 5.30, so I can send flowcode to target & see what is going on then.
Can you load a different version to check, as it could even be a power supply issue?
Martin
At work which is where I modified flowchart, so not tested it on hardware.
Be home at about 5.30, so I can send flowcode to target & see what is going on then.
Can you load a different version to check, as it could even be a power supply issue?
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: Like to read Port B then send to Port D
Not a problem I reloaded V28 and the world is safe.
If you have a quick minute at 5:30 I will be here.
I reloaded V29 and it dancing. Nice beat
Not sure why the power supply would affect 29 and not 28.
But I know the answer is in the weeds and we will find it.
John
If you have a quick minute at 5:30 I will be here.
I reloaded V29 and it dancing. Nice beat
Not sure why the power supply would affect 29 and not 28.
But I know the answer is in the weeds and we will find it.
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: Like to read Port B then send to Port D
Hello Martin
Well the wizard has a magic hat.
Odd Version 28 is drawing 2.6 Amps
Version 29 is drawing 3.5 - 4 Amps . Due to the Servo chattering
The Servo at rest draw 1/ 2 amp.
I have placed a order for a 12 Amp 5 Volt supply. About $55 ( 29 Pounds )
It is Switching Mode unit as you suggested.
John
Well the wizard has a magic hat.
Odd Version 28 is drawing 2.6 Amps
Version 29 is drawing 3.5 - 4 Amps . Due to the Servo chattering
The Servo at rest draw 1/ 2 amp.
I have placed a order for a 12 Amp 5 Volt supply. About $55 ( 29 Pounds )
It is Switching Mode unit as you suggested.
John
- Attachments
-
- 67-0560.gif (63 KiB) Viewed 13848 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: Like to read Port B then send to Port D
Hi John,
If that power supply is not up to the job either, then it could be a hardware fault or software design issue.
With the new method of hardware selection by RS232, I cant see the issue Servo 0 not working for digit 2
Here is a screen shot of Guest outputting portD for digit 2: From the screen shot you can see what pulse duration is for each of the pins on port B.
If you can test the files on your hardware and let me know how you get on.
Cheers
Martin
If that power supply is not up to the job either, then it could be a hardware fault or software design issue.
With the new method of hardware selection by RS232, I cant see the issue Servo 0 not working for digit 2
Here is a screen shot of Guest outputting portD for digit 2: From the screen shot you can see what pulse duration is for each of the pins on port B.
If you can test the files on your hardware and let me know how you get on.
Cheers
Martin
- Attachments
-
- Segment control to Servo RS232 v3 Guest.zip
- (29.79 KiB) Downloaded 216 times
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: Like to read Port B then send to Port D
Thank you for all your endless time in working through the endless events.
I believe the new power pack for the 5 Volts should be well in the range. It is a 12 Amp unit and my measurements are with a low tech meter indicating the max draw is 7.2 Amp when a digit 0 is cleared and all 7 Servo are in action.
Yes I will test all the Displays on the servo action.
Thank you for the updates.
John
I believe the new power pack for the 5 Volts should be well in the range. It is a 12 Amp unit and my measurements are with a low tech meter indicating the max draw is 7.2 Amp when a digit 0 is cleared and all 7 Servo are in action.
Yes I will test all the Displays on the servo action.
Thank you for the updates.
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: Like to read Port B then send to Port D
Hi Martin
Testing for Digit 2 works wonderful
Found a glitch with Digit 9 not activating in:
Guest
Home
Inning
These are the only displays that go 1 to 0
I did the Break point and for Digit 8 it triggers at the decision but Digit 9 doesn't make the decision ?
I will try and debug
If you have a moment maybe you can spot it.
John
Testing for Digit 2 works wonderful
Found a glitch with Digit 9 not activating in:
Guest
Home
Inning
These are the only displays that go 1 to 0
I did the Break point and for Digit 8 it triggers at the decision but Digit 9 doesn't make the decision ?
I will try and debug
If you have a moment maybe you can spot it.
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: Like to read Port B then send to Port D
Hi John,
Your welcome and thanks.
I have added to prevent wrong data being sent to score board.
It should have been since with RXData < 57 then code 0 to 8 only is within range.
Try the attached files.
Can you let me know if they are all correctly updated as I thought I sent a non updated one back before?
Your welcome and thanks.
Glad it's working.JLeith wrote:Testing for Digit 2 works wonderful
I have spotted the issue.JLeith wrote:Found a glitch with Digit 9 not activating in:
Guest
Home
Inning
I have added
Code: Select all
(RS232ReceveMode) && ((RXData < 57) && (RXData > 47) || (RXData = 99))
It should have been
Code: Select all
(RS232ReceveMode) && ((RXData < 58) && (RXData > 47) || (RXData = 99))
Try the attached files.
Can you let me know if they are all correctly updated as I thought I sent a non updated one back before?
- Attachments
-
- Segment control to Servo RS232 v4.zip
- (44.95 KiB) Downloaded 223 times
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: Like to read Port B then send to Port D
Thank you
The missing 9 is back at the party.
I tested Guest and will test everything to ensure it is all working
Great work Martin
The missing 9 is back at the party.
I tested Guest and will test everything to ensure it is all working
Great work 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: Like to read Port B then send to Port D
Thanks John,
Fingers crossed all will be working, esp when all connected together.
Did you notice I have separated each transmitted Character by a 10ms delay?
This is to increase receiving reliability.
When a char is sent the Rx interrupt is triggered no matter what part of the software is being accessed at the time.
The exception being the interrupt itself!
If the interrupt macro has not yet finished, and another char is sent, then that char will be missed.
This is because when ISR (interrupt service routine) is triggered, all the interrupts are disabled until ISR macro is exited.
With 10ms delay the ISR macro will have exited before next char is sent.
Martin
Fingers crossed all will be working, esp when all connected together.
Did you notice I have separated each transmitted Character by a 10ms delay?
This is to increase receiving reliability.
When a char is sent the Rx interrupt is triggered no matter what part of the software is being accessed at the time.
The exception being the interrupt itself!
If the interrupt macro has not yet finished, and another char is sent, then that char will be missed.
This is because when ISR (interrupt service routine) is triggered, all the interrupts are disabled until ISR macro is exited.
With 10ms delay the ISR macro will have exited before next char is sent.
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: Like to read Port B then send to Port D
That is excellent to add the 10 ms delay.
I know it has happened where I have pressed the button a second time to ensure it was received.
Yes this will make a smother flow with less errors.
I will try and complete each segments working with the servo's.
I need to work out a angle measurement tool so I can attach the horn at the right angle so when it is a 0 degree the cradle will be at 90 degree vertical and when it flips to 216 the cradle will be horizontal.
I will keep you up to date on the development.
Again thank you for your support
John
I know it has happened where I have pressed the button a second time to ensure it was received.
Yes this will make a smother flow with less errors.
I will try and complete each segments working with the servo's.
I need to work out a angle measurement tool so I can attach the horn at the right angle so when it is a 0 degree the cradle will be at 90 degree vertical and when it flips to 216 the cradle will be horizontal.
I will keep you up to date on the development.
Again thank you for your support
John