URGENT help on PIC16F1827

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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

Brendan
Posts: 227
Joined: Tue Nov 27, 2012 12:53 pm
Location: Cambridge, UK
Contact:

Re: URGENT help on PIC16F1827

Post by Brendan »

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

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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 ?
USB to TTL.jpg
USB to TTL.jpg (19.89 KiB) Viewed 7551 times
John
Attachments
USB to DB9.jpg
USB to DB9.jpg (29.86 KiB) Viewed 7551 times

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

The company is one that is on your side of the pond.

http://www.aten.co.uk/

John

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

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.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

Excellent again thank you,

Now don't I just need the (RXD ) (TXD) (GRD) (DSR) connected to the PIC

John

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

JLeith wrote:The LIGHT just went on...... There is a chip inside the USB ???
Correct There is a chip with the USB Plug that converts the +5 and 0V to USB.
JLeith wrote: http://www.elecfreaks.com/store/pl2303h ... apl9andi70

Is this what we need ??
Yes, That's exactly what you need.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

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?
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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
Attachments
RB state.jpg
RB state.jpg (15.08 KiB) Viewed 7468 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

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.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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
Attachments
RA1 to RA3.jpg
(175.59 KiB) Downloaded 2444 times

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

Hi John,
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.
I don't believe that is correct.
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).
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 ?
Unfortunately all communications are classed as advanced components, therefore only available with Pro version.

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

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

JLeith wrote:Martin can I use ( RA1 ) it looks to be the same as (RA0) ?
Sure RA1, RA2 RA3 etc will all work fine.
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.
JLeith wrote:I would like to see if your hex file will work in my Scoreboard and give me a little glimmer to upgrade .
I will edit a flowchart you have posted, and set it up for RS232 and post flowchart and hex file.

Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

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.
I will alter flowcode so when power is first applied LED is solid for a few seconds.
Then LED can flash every second to indicate program is running normally.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

:) Thank you

I have added the LED to RA3

John

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

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

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

Hi Martin,

Sent you a PM with the Flowcode May 7th

John

User avatar
JLeith
Posts: 526
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Contact:

Re: URGENT help on PIC16F1827

Post by JLeith »

Morning Martin

Just so we are on the same page here is the connection I made to RA6


John
Attachments
RA6.jpg
RA6.jpg (8.31 KiB) Viewed 7348 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8873
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: URGENT help on PIC16F1827

Post by medelec35 »

JLeith wrote:Morning Martin
Just so we are on the same page here is the connection I made to RA6
Hi John, I thought you was adding LED to RA3?
JLeith wrote:I have added the LED to RA3
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

Post Reply