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,
The fellow thought it would use the USB 5 volts if needed ?
I will try another electronic store about 45 minute drive from my house tomorrow.
When I asked about a USB to UART converter they were not familiar with the process.
I also sent an email to Matrix on the Flowcode 5 that I have and I was not happy that I might have to spend more $$$$.
How does the USB to RS232 convert with the use of 5 Volts.
I will do more Google and see a better picture.
Can we not come off the DB9 and interface to the PIC and ad in our 5 Volts ?
Can you send me a drawing of your setup ?
Maybe this will help the crew at the store.
John
The fellow thought it would use the USB 5 volts if needed ?
I will try another electronic store about 45 minute drive from my house tomorrow.
When I asked about a USB to UART converter they were not familiar with the process.
I also sent an email to Matrix on the Flowcode 5 that I have and I was not happy that I might have to spend more $$$$.
How does the USB to RS232 convert with the use of 5 Volts.
I will do more Google and see a better picture.
Can we not come off the DB9 and interface to the PIC and ad in our 5 Volts ?
Can you send me a drawing of your setup ?
Maybe this will help the crew at the store.
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
Hello gentlemen.
I can personally recommend products from FTDI for such applications.
They're very popular so widely available, and have proven themselves to be reliable...
http://www.ftdichip.com/Products/Cables ... Serial.htm
All the best,
Brendan
I can personally recommend products from FTDI for such applications.
They're very popular so widely available, and have proven themselves to be reliable...
http://www.ftdichip.com/Products/Cables ... Serial.htm
All the best,
Brendan
LinkedIn Profile...
http://www.linkedin.com/in/brendantownsend
http://www.linkedin.com/in/brendantownsend
- 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
is this what I need.
It looks as if the USB is just selecting leads to the PIC I guess.
On the product I purchased here is the DB9 break down ?
Can I not just use a female adapter and pick off the leads we need ?
John
It looks as if the USB is just selecting leads to the PIC I guess.
On the product I purchased here is the DB9 break down ?
Can I not just use a female adapter and pick off the leads we need ?
John
- Attachments
-
- USB to DB9.jpg (29.86 KiB) Viewed 13460 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 John, I have not used the DB9 to PC converter for TTL compatible voltages so I can't advise on that sorry.
I will have look on the net to see if it can be used.I will let you know asap.
I agree with Brendan as I have used FTDI and Silicon Labs TTL to usb converter.
I will have look on the net to see if it can be used.I will let you know asap.
I agree with Brendan as I have used FTDI and Silicon Labs TTL to usb converter.
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 again thank you,
Now don't I just need the (RXD ) (TXD) (GRD) (DSR) connected to the PIC
John
Now don't I just need the (RXD ) (TXD) (GRD) (DSR) connected to the PIC
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
The LIGHT just went on...... There is a chip inside the USB ???
http://www.elecfreaks.com/store/pl2303h ... apl9andi70
Is this what we need ??
John
http://www.elecfreaks.com/store/pl2303h ... apl9andi70
Is this what we need ??
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
Correct There is a chip with the USB Plug that converts the +5 and 0V to USB.JLeith wrote:The LIGHT just went on...... There is a chip inside the USB ???
Yes, That's exactly what you need.
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 placed the order and it should be about 5 days to reach me.
I will post when it arrives.
Martin I see there is 4 connections I have to make can you tell me where I should make them so I can put in a header to plug the leads into.
John
I placed the order and it should be about 5 days to reach me.
I will post when it arrives.
Martin I see there is 4 connections I have to make can you tell me where I should make them so I can put in a header to plug the leads into.
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
You have two options
1) use the built in RS232 (actually called USART or if enhanced EUSART functions ) TX (RB2) for transmitting
Or
2) What I do is use software option on the same pin as used for ICSP data.
That way I do not need to use any extra headers, and RS232 Comms lead is spliced into the data and VSS(GND) of ICSP lead.
You will only require 2 connections from TTL to USB converter. RXD and GND.
Other connections are not required since you're not sending any data from say PC keyboard to the microcontroller.
The difference between the two options are are with 1 you can send data at a faster rate but in your case for diagnostics, its not really necessary.
If receiving data, then using hardware to receive is always recommended but you're not using that function.
Are you programming via ICSP?
1) use the built in RS232 (actually called USART or if enhanced EUSART functions ) TX (RB2) for transmitting
Or
2) What I do is use software option on the same pin as used for ICSP data.
That way I do not need to use any extra headers, and RS232 Comms lead is spliced into the data and VSS(GND) of ICSP lead.
You will only require 2 connections from TTL to USB converter. RXD and GND.
Other connections are not required since you're not sending any data from say PC keyboard to the microcontroller.
The difference between the two options are are with 1 you can send data at a faster rate but in your case for diagnostics, its not really necessary.
If receiving data, then using hardware to receive is always recommended but you're not using that function.
Are you programming via ICSP?
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
Option 2 is one that I use to program the PIC.
I use the PICKIT 2 and flowcode to program the PIC.
PIN 1 - VPP (MCLR)
PIN 2 - VDD ( +5 )
PIN 3 - VSS (GRD )
PIN 4 - DAT ( RB13 )
PIN 5 - CLK ( PIN 12 )
For the programming I tried to use a RJ11 mounted on my PIC PCB but that failed.
I worked with Microchip support and when all was done I had to use a breadboard to connect the PICKIT 2 and program the PIC.
It had something to do with lead length for the PICKIT 2 and the PIC when it was connected thru the RJ11.
Martin I will add a 4 PIN (100mil pins) to my PIC PCB so I can connect the USB TTL device.
Won't we need the live PIC function to see the messages when the Scoreboard is running ?
Martin will I have an error when we go to do this that I'm using the RB6 & RB7 as controls for the scoreboard and RB 6 is the CLK and RB 7 is the DATA ?
I guess we can't use the RA pins for collecting the errors ?
Here is the snap shot of the RB pins
Will we be able to see what is happening with the PIC is the RB is doing double duty ?
John
Option 2 is one that I use to program the PIC.
I use the PICKIT 2 and flowcode to program the PIC.
PIN 1 - VPP (MCLR)
PIN 2 - VDD ( +5 )
PIN 3 - VSS (GRD )
PIN 4 - DAT ( RB13 )
PIN 5 - CLK ( PIN 12 )
For the programming I tried to use a RJ11 mounted on my PIC PCB but that failed.
I worked with Microchip support and when all was done I had to use a breadboard to connect the PICKIT 2 and program the PIC.
It had something to do with lead length for the PICKIT 2 and the PIC when it was connected thru the RJ11.
Martin I will add a 4 PIN (100mil pins) to my PIC PCB so I can connect the USB TTL device.
Won't we need the live PIC function to see the messages when the Scoreboard is running ?
Martin will I have an error when we go to do this that I'm using the RB6 & RB7 as controls for the scoreboard and RB 6 is the CLK and RB 7 is the DATA ?
I guess we can't use the RA pins for collecting the errors ?
Here is the snap shot of the RB pins
Will we be able to see what is happening with the PIC is the RB is doing double duty ?
John
- Attachments
-
- RB state.jpg (15.08 KiB) Viewed 13377 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
If your already using programming pins to control relays etc. then best to connect to a pin thats not in use.
Yes you can use any of the RA pins so long as they work as an output and nor open collector (unless have a pull-up resistor connected).
For example. All you need is an additional header pin connected to RA0
Then your TTL to USB will connect between GND and RA0.
Yes you can use any of the RA pins so long as they work as an output and nor open collector (unless have a pull-up resistor connected).
For example. All you need is an additional header pin connected to RA0
Then your TTL to USB will connect between GND and RA0.
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,
Martin I must say I'm so happy that you are helping me with this project. I was so close in giving up on the PIC and my investment because I was completely out of option.
Your vision is wonderful.
Then I can use the RA 1 pin as the TX for the TTL and GRD I see the RA1 is a bidirectional pin.
RA0 is used as a timer and RA 4 is a RC timer input that is sent to RA 0.
I have copied the info on the PINS.
Martin I don't know the solid ins and outs of the PIC but with your help maybe I will get a stronger support for the PIC. I'm from the age of input gets you a output. Simple AND and OR.
Martin is you can Identify the RA pin that will work I will make the Header.
John
Martin I must say I'm so happy that you are helping me with this project. I was so close in giving up on the PIC and my investment because I was completely out of option.
Your vision is wonderful.
Then I can use the RA 1 pin as the TX for the TTL and GRD I see the RA1 is a bidirectional pin.
RA0 is used as a timer and RA 4 is a RC timer input that is sent to RA 0.
I have copied the info on the PINS.
Martin I don't know the solid ins and outs of the PIC but with your help maybe I will get a stronger support for the PIC. I'm from the age of input gets you a output. Simple AND and OR.
Martin is you can Identify the RA pin that will work I will make the Header.
John
- Attachments
-
- RA1 to RA3.jpg
- (175.59 KiB) Downloaded 2444 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: URGENT help on PIC16F1827
Martin I just heard back from Matrix Support and you are correct that my Student version will not support RS232.
They said it is easy to up grade my Version 5 to Professional for a cost of 199 pounds or $302 dollars Canadian.
I just about fell off my chair to Upgrade from Version 4 to Pro is $49 pounds.
Martin I'm on a Pension and $302 is a slap to come up with in a quick 10 days.
I sent my concern back to Support on the $$$$ to get a single function to work I don't need a professional flowcode with all the Bells & Whistles.
Martin what version are you running ?
John
They said it is easy to up grade my Version 5 to Professional for a cost of 199 pounds or $302 dollars Canadian.
I just about fell off my chair to Upgrade from Version 4 to Pro is $49 pounds.
Martin I'm on a Pension and $302 is a slap to come up with in a quick 10 days.
I sent my concern back to Support on the $$$$ to get a single function to work I don't need a professional flowcode with all the Bells & Whistles.
Martin what version are you running ?
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
Hi John,
Since you already have Home version = £49
Then Pro version for you will cost 199-49 = £150 not £199
(to get pro for £150 you will need to enter your key on the Flowcode v5 Sales and Upgrades page).
I will stick to my word and will generate a hex file for you as I have the Pro version.
So you can see if a pro version is what you really want.
As for Port A, since RS232 will be bit banged, any pin which states 'General purpose I/O.' So long as it mentions TTL.
So you can take your pick as it looks like RA0 to RA7 are suitable.
If it was me, I would just go for RA0, since others are used for osc or VPP (definitely not connect to VPP so RA5 is out of the question)
I don't believe that is correct.JLeith wrote:They said it is easy to up grade my Version 5 to Professional for a cost of 199 pounds or $302 dollars Canadian.
Since you already have Home version = £49
Then Pro version for you will cost 199-49 = £150 not £199
(to get pro for £150 you will need to enter your key on the Flowcode v5 Sales and Upgrades page).
Unfortunately all communications are classed as advanced components, therefore only available with Pro version.JLeith wrote:I sent my concern back to Support on the $$$$ to get a single function to work I don't need a professional flowcode with all the Bells & Whistles.
Martin what version are you running ?
I will stick to my word and will generate a hex file for you as I have the Pro version.
So you can see if a pro version is what you really want.
As for Port A, since RS232 will be bit banged, any pin which states 'General purpose I/O.' So long as it mentions TTL.
So you can take your pick as it looks like RA0 to RA7 are suitable.
If it was me, I would just go for RA0, since others are used for osc or VPP (definitely not connect to VPP so RA5 is out of the question)
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
Hi Martin well it is a hot one today it is 10 AM here and we have reached 31 C this morning.
You are correct it is 199 - 49 ( 150 pounds ) ($234 Canadian ) I was hoping for about $75 to upgrade or 48 pounds.
Martin I cant use RA0 it is being used as a TIMER from RA4 to select the Segment on time to 250 msec so as not to burn out the coils in the flip segments.
Martin can I use ( RA1 ) it looks to be the same as (RA0) ?
I don't know the difference in SPI data out put on RA0 to Sale Select input 2 for RA1
I will check my account and work to generate the $150 pounds ASAP.
I would like to see if your hex file will work in my Scoreboard and give me a little glimmer to upgrade .
John
You are correct it is 199 - 49 ( 150 pounds ) ($234 Canadian ) I was hoping for about $75 to upgrade or 48 pounds.
Martin I cant use RA0 it is being used as a TIMER from RA4 to select the Segment on time to 250 msec so as not to burn out the coils in the flip segments.
Martin can I use ( RA1 ) it looks to be the same as (RA0) ?
I don't know the difference in SPI data out put on RA0 to Sale Select input 2 for RA1
I will check my account and work to generate the $150 pounds ASAP.
I would like to see if your hex file will work in my Scoreboard and give me a little glimmer to upgrade .
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
Sure RA1, RA2 RA3 etc will all work fine.JLeith wrote:Martin can I use ( RA1 ) it looks to be the same as (RA0) ?
You're not using SPI (Serial Peripheral Interface) function. You will be just using port as input/output.
RS232 will just make i/o port high and low at the correct times.
Thats you I suggested just to look for General purpose I/O. All the other functions can be ignored (except VPP)
I do have one possible reason for your issues?
Any inductive loads e.g relays, port valves etc
Can cause very sharp spikes on the power supply, and what happens is chip browns out.
So can you place a routine at the very beginning of flowchart above main loop (so this routine only gets accessed when supply is first applied)
E.g LED lights for 5 seconds.
So every time you 1st put power to your circuit or chip resets, then LED will light for 5 seconds.
I will edit a flowchart you have posted, and set it up for RS232 and post flowchart and hex file.JLeith wrote:I would like to see if your hex file will work in my Scoreboard and give me a little glimmer to upgrade .
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
Martin thank you,
I will see if I can scope the 5 Volt line but I do see your point that static pulse's are an enemy to all.
Thank you for the Flowcode code changes and the HEX file.
I will go and see if I can capture the spikes.
I just purchased a independent 5 volt power supply and I have just to add the jack to the case.
John
I will see if I can scope the 5 Volt line but I do see your point that static pulse's are an enemy to all.
Thank you for the Flowcode code changes and the HEX file.
I will go and see if I can capture the spikes.
I just purchased a independent 5 volt power supply and I have just to add the jack to the case.
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
Martin maybe add a routing to turn on a led say to RA3 and I will add the LED to my PCB for the PIC.
Off to add the LED.
John
Off to add the LED.
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
I will alter flowcode so when power is first applied LED is solid for a few seconds.JLeith wrote:Martin maybe add a routing to turn on a led say to RA3 and I will add the LED to my PCB for the PIC.
Off to add the LED.
Then LED can flash every second to indicate program is running normally.
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
Hi John, can you either post your latest flowchart, or if you want to keep it private then PM me with it please.
Martin
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
Morning Martin
Just so we are on the same page here is the connection I made to RA6
John
Just so we are on the same page here is the connection I made to RA6
John
- Attachments
-
- RA6.jpg (8.31 KiB) Viewed 13257 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 John, I thought you was adding LED to RA3?JLeith wrote:Morning Martin
Just so we are on the same page here is the connection I made to RA6
JLeith wrote:I have added the LED to RA3
Martin