Discussion:
[PIC] Using USB with the 18F4520!
Clint Jay
2017-11-14 12:47:26 UTC
Permalink
There may be, I've usually just rolled my own routines to service the
EUSART though I haven't used the '4520 specifically.

I don't think there are huge differences between most EUSART enabled mid
range devices so there should be plenty of example code to examine and
modify for your needs.

You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to the
PIC. I just found out that all that I need to do is treat the connection
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would suggest that
you're going to connect your PIC to the PC with an FTDI USB to serial
device?
Or have I misunderstood and you're hoping to connect the PIC to the FTDI
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC 18F4520.
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration Code to
a 24C512 serial EPROM. When I add additional devices I want to be able
to update the EPROM. I also want to be able to use a Win 8.1 64bit Pro
PC to control the Programmer. I also do a lot of searching and research
on materials that I acquire from the MicroChip website. I have been
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest versions of
the X8, X18, and X32 Compilers installed. I also see that I need to
install the latest versions of C30 C and C18 C Compilers and setup the
proper Paths for these files. I don't mind doing the footwork. I am
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Richard Pope
2017-11-14 12:56:17 UTC
Permalink
Clint,
I'll do that this evening after I get up. I appreciate the insight
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service the
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART enabled mid
range devices so there should be plenty of example code to examine and
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to the
PIC. I just found out that all that I need to do is treat the connection
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would suggest that
you're going to connect your PIC to the PC with an FTDI USB to serial
device?
Or have I misunderstood and you're hoping to connect the PIC to the FTDI
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC 18F4520.
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration Code to
a 24C512 serial EPROM. When I add additional devices I want to be able
to update the EPROM. I also want to be able to use a Win 8.1 64bit Pro
PC to control the Programmer. I also do a lot of searching and research
on materials that I acquire from the MicroChip website. I have been
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest versions of
the X8, X18, and X32 Compilers installed. I also see that I need to
install the latest versions of C30 C and C18 C Compilers and setup the
proper Paths for these files. I don't mind doing the footwork. I am
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Anthony Nixon
2017-11-14 13:54:26 UTC
Permalink
You wont need a level translator with the FTDI chip. It will directly
interface to the PIC, and the FTDI directly interfaces to the USB port
with the right support components which are just a handful of
passives.

The trick is whether or not the FTDI will be powered by the USB port
or by the PIC circuit.

cheers

Tony
Clint,
I'll do that this evening after I get up. I appreciate the insight
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service the
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART enabled mid
range devices so there should be plenty of example code to examine and
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to the
PIC. I just found out that all that I need to do is treat the connection
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would suggest that
you're going to connect your PIC to the PC with an FTDI USB to serial
device?
Or have I misunderstood and you're hoping to connect the PIC to the FTDI
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC 18F4520.
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration Code to
a 24C512 serial EPROM. When I add additional devices I want to be able
to update the EPROM. I also want to be able to use a Win 8.1 64bit Pro
PC to control the Programmer. I also do a lot of searching and research
on materials that I acquire from the MicroChip website. I have been
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest versions of
the X8, X18, and X32 Compilers installed. I also see that I need to
install the latest versions of C30 C and C18 C Compilers and setup the
proper Paths for these files. I don't mind doing the footwork. I am
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Byron Jeff
2017-11-14 14:54:47 UTC
Permalink
Tony,

There are actually two types of FTDI serial ports. There is the RS232 one
with a DB9 connector on the end. Typically that port will signal between
+/- 7 volts or so. Then there are the small FTDI TTL serial adapters.
Depending on configuration they will swing either between 0 and 5 volts or
0 and 3.3 volts.

In today's serial PC world rarely does an actual MAX232 need to be used for
level translation. Even with actual RS232 ports, virtually all of them
signal properly with a 0/5V TTL signal. Note that the sign is inverted such
that a logical 1 is represented by 0V and a zero by 5V.

For years I've used a simple voltage clamp to limit the swings. The basic
circuit is here: Loading Image... D1 conducts when Vin
is above VMax and D2 conducts then Vin is below Vmin. R limits the current.
I typically put a second resistor after the clamp. I find that 1K for both
works well with PIC inputs.

A couple of variations are helpful. If D1 and D2 are Schotty diodes then
the voltage overshoot is typically only 0.3V or so. Also if D2 is a Zener
then D1 is unnecessary because the Zener action will limit the high voltage
while normal conduction clamps the low voltage.

With the signal inverted there are a few things you can do to manage it.
I've been using PIC24FV parts for several years. The hardware EUARTS on
them can be inverted in software. It is also possible to bit bang a digital
input/output for serial. Otherwise a NPN transistor whose base is connected
to Vout, emitter grounded, and a pullup collector will invert the signal in
hardware.

Another thought that may be traitorous on this board: ever considered an
Arduino? Complete boards with the USB serial adapter on board clock in at
about $5 USD. Boards like a Nano will plug right into a breadboard. Plug in
a USB cable, load the Arduino IDE and you're going literally in about 5
minutes. Tons of libraries already built into the platform.

As I've progressed in the hobby, I find that sometimes it's just more
trouble than it's worth to try to roll everything from scratch. Back in the
PIC 16C54 days, the price and functionality was a compelling reason to
switch as compared to the alternatives. But in 2017 with high level boards
such as a Raspberry PI Zero W that runs Linux and having a complete wireles setup
for less than $10 USD and Arduino clones literally running 5 for $20, it
becomes more difficult to justify wiring up a board from scratch and
programming in assembly anymore. Those who have never done it may need the
experience. But those of us who have a closetfull of t-shirts with
'Assembly coder' emblazoned upon them? Not so much. I find now that I spend
more time and energy trying to match the hardware/firmware to the
application. It literally may be more adventageous to throw a RasPi ZeroW
into a problem to make a wireless remote light switch than any alternative for
example.

BAJ
Post by Anthony Nixon
You wont need a level translator with the FTDI chip. It will directly
interface to the PIC, and the FTDI directly interfaces to the USB port
with the right support components which are just a handful of
passives.
The trick is whether or not the FTDI will be powered by the USB port
or by the PIC circuit.
cheers
Tony
Clint,
I'll do that this evening after I get up. I appreciate the insight
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service the
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART enabled mid
range devices so there should be plenty of example code to examine and
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to the
PIC. I just found out that all that I need to do is treat the connection
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would suggest that
you're going to connect your PIC to the PC with an FTDI USB to serial
device?
Or have I misunderstood and you're hoping to connect the PIC to the FTDI
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC 18F4520.
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration Code to
a 24C512 serial EPROM. When I add additional devices I want to be able
to update the EPROM. I also want to be able to use a Win 8.1 64bit Pro
PC to control the Programmer. I also do a lot of searching and research
on materials that I acquire from the MicroChip website. I have been
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest versions of
the X8, X18, and X32 Compilers installed. I also see that I need to
install the latest versions of C30 C and C18 C Compilers and setup the
proper Paths for these files. I don't mind doing the footwork. I am
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Byron A. Jeff
Associate Professor: Department of Computer Science and Information Technology
College of Information and Mathematical Sciences
Clayton State University
http://faculty.clayton.edu/bjeff
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Clint Jay
2017-11-14 15:04:26 UTC
Permalink
Jeff, you raise good points but I would prefer to be safe than sorry,
designing/building and coding for the MAX232 or other serial driver will
ensure compatibility (as far as RS-232 is able to be compatible) with the
widest range of PCs and prevent anything 'unpleasant' happening if the
device is plugged into an unknown machine.

As heretical as it would seem I'd have to admit you may have a point about
Arduino, it's a known hardware platform that is proven to work.

Similarly, I've been exploring options with STM32 Blue Pill boards recently
but I still like and write code for PIC devices, as and when I need extra
horsepower I may well leave the PIC Path and move to ARM, they're *so*
cheap and have an abundance of facilities.
Post by Byron Jeff
Tony,
There are actually two types of FTDI serial ports. There is the RS232 one
with a DB9 connector on the end. Typically that port will signal between
+/- 7 volts or so. Then there are the small FTDI TTL serial adapters.
Depending on configuration they will swing either between 0 and 5 volts or
0 and 3.3 volts.
In today's serial PC world rarely does an actual MAX232 need to be used for
level translation. Even with actual RS232 ports, virtually all of them
signal properly with a 0/5V TTL signal. Note that the sign is inverted such
that a logical 1 is represented by 0V and a zero by 5V.
For years I've used a simple voltage clamp to limit the swings. The basic
circuit is here: https://i.stack.imgur.com/jyZvD.gif D1 conducts when Vin
is above VMax and D2 conducts then Vin is below Vmin. R limits the current.
I typically put a second resistor after the clamp. I find that 1K for both
works well with PIC inputs.
A couple of variations are helpful. If D1 and D2 are Schotty diodes then
the voltage overshoot is typically only 0.3V or so. Also if D2 is a Zener
then D1 is unnecessary because the Zener action will limit the high voltage
while normal conduction clamps the low voltage.
With the signal inverted there are a few things you can do to manage it.
I've been using PIC24FV parts for several years. The hardware EUARTS on
them can be inverted in software. It is also possible to bit bang a digital
input/output for serial. Otherwise a NPN transistor whose base is connected
to Vout, emitter grounded, and a pullup collector will invert the signal in
hardware.
Another thought that may be traitorous on this board: ever considered an
Arduino? Complete boards with the USB serial adapter on board clock in at
about $5 USD. Boards like a Nano will plug right into a breadboard. Plug in
a USB cable, load the Arduino IDE and you're going literally in about 5
minutes. Tons of libraries already built into the platform.
As I've progressed in the hobby, I find that sometimes it's just more
trouble than it's worth to try to roll everything from scratch. Back in the
PIC 16C54 days, the price and functionality was a compelling reason to
switch as compared to the alternatives. But in 2017 with high level boards
such as a Raspberry PI Zero W that runs Linux and having a complete wireles setup
for less than $10 USD and Arduino clones literally running 5 for $20, it
becomes more difficult to justify wiring up a board from scratch and
programming in assembly anymore. Those who have never done it may need the
experience. But those of us who have a closetfull of t-shirts with
'Assembly coder' emblazoned upon them? Not so much. I find now that I spend
more time and energy trying to match the hardware/firmware to the
application. It literally may be more adventageous to throw a RasPi ZeroW
into a problem to make a wireless remote light switch than any alternative for
example.
BAJ
Post by Anthony Nixon
You wont need a level translator with the FTDI chip. It will directly
interface to the PIC, and the FTDI directly interfaces to the USB port
with the right support components which are just a handful of
passives.
The trick is whether or not the FTDI will be powered by the USB port
or by the PIC circuit.
cheers
Tony
Clint,
I'll do that this evening after I get up. I appreciate the insight
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service the
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART
enabled mid
Post by Anthony Nixon
Post by Clint Jay
range devices so there should be plenty of example code to examine and
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to the
PIC. I just found out that all that I need to do is treat the
connection
Post by Anthony Nixon
Post by Clint Jay
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would suggest
that
Post by Anthony Nixon
Post by Clint Jay
you're going to connect your PIC to the PC with an FTDI USB to
serial
Post by Anthony Nixon
Post by Clint Jay
device?
Or have I misunderstood and you're hoping to connect the PIC to the
FTDI
Post by Anthony Nixon
Post by Clint Jay
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC
18F4520.
Post by Anthony Nixon
Post by Clint Jay
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration
Code to
Post by Anthony Nixon
Post by Clint Jay
a 24C512 serial EPROM. When I add additional devices I want to be
able
Post by Anthony Nixon
Post by Clint Jay
to update the EPROM. I also want to be able to use a Win 8.1 64bit
Pro
Post by Anthony Nixon
Post by Clint Jay
PC to control the Programmer. I also do a lot of searching and
research
Post by Anthony Nixon
Post by Clint Jay
on materials that I acquire from the MicroChip website. I have been
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest
versions of
Post by Anthony Nixon
Post by Clint Jay
the X8, X18, and X32 Compilers installed. I also see that I need to
install the latest versions of C30 C and C18 C Compilers and setup
the
Post by Anthony Nixon
Post by Clint Jay
proper Paths for these files. I don't mind doing the footwork. I am
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Byron A. Jeff
Associate Professor: Department of Computer Science and Information Technology
College of Information and Mathematical Sciences
Clayton State University
http://faculty.clayton.edu/bjeff
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Clint.

*No trees were harmed in the sending of this mail. However, a large number
of electrons were greatly inconvenienced.*
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
James Cameron
2017-11-14 21:18:11 UTC
Permalink
Thanks for the STM32 Blue Pill reference. An interesting looking board.
Post by Clint Jay
Jeff, you raise good points but I would prefer to be safe than sorry,
designing/building and coding for the MAX232 or other serial driver will
ensure compatibility (as far as RS-232 is able to be compatible) with the
widest range of PCs and prevent anything 'unpleasant' happening if the
device is plugged into an unknown machine.
As heretical as it would seem I'd have to admit you may have a point about
Arduino, it's a known hardware platform that is proven to work.
Similarly, I've been exploring options with STM32 Blue Pill boards recently
but I still like and write code for PIC devices, as and when I need extra
horsepower I may well leave the PIC Path and move to ARM, they're *so*
cheap and have an abundance of facilities.
Post by Byron Jeff
Tony,
There are actually two types of FTDI serial ports. There is the RS232 one
with a DB9 connector on the end. Typically that port will signal between
+/- 7 volts or so. Then there are the small FTDI TTL serial adapters.
Depending on configuration they will swing either between 0 and 5 volts or
0 and 3.3 volts.
In today's serial PC world rarely does an actual MAX232 need to be used for
level translation. Even with actual RS232 ports, virtually all of them
signal properly with a 0/5V TTL signal. Note that the sign is inverted such
that a logical 1 is represented by 0V and a zero by 5V.
For years I've used a simple voltage clamp to limit the swings. The basic
circuit is here: https://i.stack.imgur.com/jyZvD.gif D1 conducts when Vin
is above VMax and D2 conducts then Vin is below Vmin. R limits the current.
I typically put a second resistor after the clamp. I find that 1K for both
works well with PIC inputs.
A couple of variations are helpful. If D1 and D2 are Schotty diodes then
the voltage overshoot is typically only 0.3V or so. Also if D2 is a Zener
then D1 is unnecessary because the Zener action will limit the high voltage
while normal conduction clamps the low voltage.
With the signal inverted there are a few things you can do to manage it.
I've been using PIC24FV parts for several years. The hardware EUARTS on
them can be inverted in software. It is also possible to bit bang a digital
input/output for serial. Otherwise a NPN transistor whose base is connected
to Vout, emitter grounded, and a pullup collector will invert the signal in
hardware.
Another thought that may be traitorous on this board: ever considered an
Arduino? Complete boards with the USB serial adapter on board clock in at
about $5 USD. Boards like a Nano will plug right into a breadboard. Plug in
a USB cable, load the Arduino IDE and you're going literally in about 5
minutes. Tons of libraries already built into the platform.
As I've progressed in the hobby, I find that sometimes it's just more
trouble than it's worth to try to roll everything from scratch. Back in the
PIC 16C54 days, the price and functionality was a compelling reason to
switch as compared to the alternatives. But in 2017 with high level boards
such as a Raspberry PI Zero W that runs Linux and having a complete wireles setup
for less than $10 USD and Arduino clones literally running 5 for $20, it
becomes more difficult to justify wiring up a board from scratch and
programming in assembly anymore. Those who have never done it may need the
experience. But those of us who have a closetfull of t-shirts with
'Assembly coder' emblazoned upon them? Not so much. I find now that I spend
more time and energy trying to match the hardware/firmware to the
application. It literally may be more adventageous to throw a RasPi ZeroW
into a problem to make a wireless remote light switch than any alternative for
example.
BAJ
Post by Anthony Nixon
You wont need a level translator with the FTDI chip. It will directly
interface to the PIC, and the FTDI directly interfaces to the USB port
with the right support components which are just a handful of
passives.
The trick is whether or not the FTDI will be powered by the USB port
or by the PIC circuit.
cheers
Tony
Clint,
I'll do that this evening after I get up. I appreciate the insight
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service the
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART
enabled mid
Post by Anthony Nixon
Post by Clint Jay
range devices so there should be plenty of example code to examine and
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to the
PIC. I just found out that all that I need to do is treat the
connection
Post by Anthony Nixon
Post by Clint Jay
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would suggest
that
Post by Anthony Nixon
Post by Clint Jay
you're going to connect your PIC to the PC with an FTDI USB to
serial
Post by Anthony Nixon
Post by Clint Jay
device?
Or have I misunderstood and you're hoping to connect the PIC to the
FTDI
Post by Anthony Nixon
Post by Clint Jay
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC
18F4520.
Post by Anthony Nixon
Post by Clint Jay
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration
Code to
Post by Anthony Nixon
Post by Clint Jay
a 24C512 serial EPROM. When I add additional devices I want to be
able
Post by Anthony Nixon
Post by Clint Jay
to update the EPROM. I also want to be able to use a Win 8.1 64bit
Pro
Post by Anthony Nixon
Post by Clint Jay
PC to control the Programmer. I also do a lot of searching and
research
Post by Anthony Nixon
Post by Clint Jay
on materials that I acquire from the MicroChip website. I have been
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest
versions of
Post by Anthony Nixon
Post by Clint Jay
the X8, X18, and X32 Compilers installed. I also see that I need to
install the latest versions of C30 C and C18 C Compilers and setup
the
Post by Anthony Nixon
Post by Clint Jay
proper Paths for these files. I don't mind doing the footwork. I am
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Byron A. Jeff
Associate Professor: Department of Computer Science and Information Technology
College of Information and Mathematical Sciences
Clayton State University
http://faculty.clayton.edu/bjeff
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Clint.
*No trees were harmed in the sending of this mail. However, a large number
of electrons were greatly inconvenienced.*
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
James Cameron
http://quozl.netrek.org/
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Richard Pope
2017-11-14 23:42:17 UTC
Permalink
Hello James, Jeff, Tony,
I considered the Arduino and the ATMEGA32 but I needed a lot of I/O
and I don't need CPP or Analog. Yes, there is more support for the
Arduino but there is a lot out there for the PIC. I could use some more
I/O pins. I am using shift registers to control the address lines going
to the programming socket and a 8 to 3 encoder chip for the interrupts.
The FTDI chip that I am considering is a FT232RL. It will be
connected to the PIC in a direct manner and only the USB side will be
able to connect to a PC. I know that the RS232 port on the PIC swings 0
to 5 volts. I'll have to check the datasheet for the FT232RL to see if
it swings 0 to 3.3 or 5 volts. I don't know.
I use C to do my coding. I understand Assembly to a certain point.
I am able to follow along the code and see what is going on but I have a
difficult time creating my own Assembly programs. I am going to run the
4520 at 40MHz so speed isn't going to be a big issue for the programmer.
Right now I am using relays to switch the Address lines and various
programming voltages to the appropriate pins on the programming socket.
I found a program for controlling a LCD on the MC website. The
only problem is that I can't find where that Data Pins are being
defined. I found the definitions for the control lines.
Thanks,
rich!
Post by James Cameron
Thanks for the STM32 Blue Pill reference. An interesting looking board.
Post by Clint Jay
Jeff, you raise good points but I would prefer to be safe than sorry,
designing/building and coding for the MAX232 or other serial driver will
ensure compatibility (as far as RS-232 is able to be compatible) with the
widest range of PCs and prevent anything 'unpleasant' happening if the
device is plugged into an unknown machine.
As heretical as it would seem I'd have to admit you may have a point about
Arduino, it's a known hardware platform that is proven to work.
Similarly, I've been exploring options with STM32 Blue Pill boards recently
but I still like and write code for PIC devices, as and when I need extra
horsepower I may well leave the PIC Path and move to ARM, they're *so*
cheap and have an abundance of facilities.
Post by Byron Jeff
Tony,
There are actually two types of FTDI serial ports. There is the RS232 one
with a DB9 connector on the end. Typically that port will signal between
+/- 7 volts or so. Then there are the small FTDI TTL serial adapters.
Depending on configuration they will swing either between 0 and 5 volts or
0 and 3.3 volts.
In today's serial PC world rarely does an actual MAX232 need to be used for
level translation. Even with actual RS232 ports, virtually all of them
signal properly with a 0/5V TTL signal. Note that the sign is inverted such
that a logical 1 is represented by 0V and a zero by 5V.
For years I've used a simple voltage clamp to limit the swings. The basic
circuit is here: https://i.stack.imgur.com/jyZvD.gif D1 conducts when Vin
is above VMax and D2 conducts then Vin is below Vmin. R limits the current.
I typically put a second resistor after the clamp. I find that 1K for both
works well with PIC inputs.
A couple of variations are helpful. If D1 and D2 are Schotty diodes then
the voltage overshoot is typically only 0.3V or so. Also if D2 is a Zener
then D1 is unnecessary because the Zener action will limit the high voltage
while normal conduction clamps the low voltage.
With the signal inverted there are a few things you can do to manage it.
I've been using PIC24FV parts for several years. The hardware EUARTS on
them can be inverted in software. It is also possible to bit bang a digital
input/output for serial. Otherwise a NPN transistor whose base is connected
to Vout, emitter grounded, and a pullup collector will invert the signal in
hardware.
Another thought that may be traitorous on this board: ever considered an
Arduino? Complete boards with the USB serial adapter on board clock in at
about $5 USD. Boards like a Nano will plug right into a breadboard. Plug in
a USB cable, load the Arduino IDE and you're going literally in about 5
minutes. Tons of libraries already built into the platform.
As I've progressed in the hobby, I find that sometimes it's just more
trouble than it's worth to try to roll everything from scratch. Back in the
PIC 16C54 days, the price and functionality was a compelling reason to
switch as compared to the alternatives. But in 2017 with high level boards
such as a Raspberry PI Zero W that runs Linux and having a complete wireles setup
for less than $10 USD and Arduino clones literally running 5 for $20, it
becomes more difficult to justify wiring up a board from scratch and
programming in assembly anymore. Those who have never done it may need the
experience. But those of us who have a closetfull of t-shirts with
'Assembly coder' emblazoned upon them? Not so much. I find now that I spend
more time and energy trying to match the hardware/firmware to the
application. It literally may be more adventageous to throw a RasPi ZeroW
into a problem to make a wireless remote light switch than any alternative for
example.
BAJ
Post by Anthony Nixon
You wont need a level translator with the FTDI chip. It will directly
interface to the PIC, and the FTDI directly interfaces to the USB port
with the right support components which are just a handful of
passives.
The trick is whether or not the FTDI will be powered by the USB port
or by the PIC circuit.
cheers
Tony
Clint,
I'll do that this evening after I get up. I appreciate the insight
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service the
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART
enabled mid
Post by Anthony Nixon
Post by Clint Jay
range devices so there should be plenty of example code to examine and
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to the
PIC. I just found out that all that I need to do is treat the
connection
Post by Anthony Nixon
Post by Clint Jay
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would suggest
that
Post by Anthony Nixon
Post by Clint Jay
you're going to connect your PIC to the PC with an FTDI USB to
serial
Post by Anthony Nixon
Post by Clint Jay
device?
Or have I misunderstood and you're hoping to connect the PIC to the
FTDI
Post by Anthony Nixon
Post by Clint Jay
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC
18F4520.
Post by Anthony Nixon
Post by Clint Jay
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration
Code to
Post by Anthony Nixon
Post by Clint Jay
a 24C512 serial EPROM. When I add additional devices I want to be
able
Post by Anthony Nixon
Post by Clint Jay
to update the EPROM. I also want to be able to use a Win 8.1 64bit
Pro
Post by Anthony Nixon
Post by Clint Jay
PC to control the Programmer. I also do a lot of searching and
research
Post by Anthony Nixon
Post by Clint Jay
on materials that I acquire from the MicroChip website. I have been
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest
versions of
Post by Anthony Nixon
Post by Clint Jay
the X8, X18, and X32 Compilers installed. I also see that I need to
install the latest versions of C30 C and C18 C Compilers and setup
the
Post by Anthony Nixon
Post by Clint Jay
proper Paths for these files. I don't mind doing the footwork. I am
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Byron A. Jeff
Associate Professor: Department of Computer Science and Information Technology
College of Information and Mathematical Sciences
Clayton State University
http://faculty.clayton.edu/bjeff
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Clint.
*No trees were harmed in the sending of this mail. However, a large number
of electrons were greatly inconvenienced.*
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Chris Roper
2017-11-15 05:45:22 UTC
Permalink
Take a look at http://gcbasic.com/
It is a compiler, it supports your device, has drivers / examples for most
of what you have mentioned, is far easier than Assembler or C and is free.
To set up a serial connection via FTDI and control an LCD is only about
half a dozen lines of code in GCBASIC.
I also find that the code it generates is far better optimized than XC8
code.
It is a great way to get started but is by no means confined only to
beginners it had some very advanced capabilities, supports over 1100 chips
from the PIC and AVR families with full portability.

Cheers
Chris
Post by Richard Pope
Hello James, Jeff, Tony,
I considered the Arduino and the ATMEGA32 but I needed a lot of I/O
and I don't need CPP or Analog. Yes, there is more support for the
Arduino but there is a lot out there for the PIC. I could use some more
I/O pins. I am using shift registers to control the address lines going
to the programming socket and a 8 to 3 encoder chip for the interrupts.
The FTDI chip that I am considering is a FT232RL. It will be
connected to the PIC in a direct manner and only the USB side will be
able to connect to a PC. I know that the RS232 port on the PIC swings 0
to 5 volts. I'll have to check the datasheet for the FT232RL to see if
it swings 0 to 3.3 or 5 volts. I don't know.
I use C to do my coding. I understand Assembly to a certain point.
I am able to follow along the code and see what is going on but I have a
difficult time creating my own Assembly programs. I am going to run the
4520 at 40MHz so speed isn't going to be a big issue for the programmer.
Right now I am using relays to switch the Address lines and various
programming voltages to the appropriate pins on the programming socket.
I found a program for controlling a LCD on the MC website. The
only problem is that I can't find where that Data Pins are being
defined. I found the definitions for the control lines.
Thanks,
rich!
Post by James Cameron
Thanks for the STM32 Blue Pill reference. An interesting looking board.
Post by Clint Jay
Jeff, you raise good points but I would prefer to be safe than sorry,
designing/building and coding for the MAX232 or other serial driver will
ensure compatibility (as far as RS-232 is able to be compatible) with
the
Post by James Cameron
Post by Clint Jay
widest range of PCs and prevent anything 'unpleasant' happening if the
device is plugged into an unknown machine.
As heretical as it would seem I'd have to admit you may have a point
about
Post by James Cameron
Post by Clint Jay
Arduino, it's a known hardware platform that is proven to work.
Similarly, I've been exploring options with STM32 Blue Pill boards
recently
Post by James Cameron
Post by Clint Jay
but I still like and write code for PIC devices, as and when I need
extra
Post by James Cameron
Post by Clint Jay
horsepower I may well leave the PIC Path and move to ARM, they're *so*
cheap and have an abundance of facilities.
Post by Byron Jeff
Tony,
There are actually two types of FTDI serial ports. There is the RS232
one
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
with a DB9 connector on the end. Typically that port will signal
between
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
+/- 7 volts or so. Then there are the small FTDI TTL serial adapters.
Depending on configuration they will swing either between 0 and 5
volts or
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
0 and 3.3 volts.
In today's serial PC world rarely does an actual MAX232 need to be
used for
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
level translation. Even with actual RS232 ports, virtually all of them
signal properly with a 0/5V TTL signal. Note that the sign is inverted
such
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
that a logical 1 is represented by 0V and a zero by 5V.
For years I've used a simple voltage clamp to limit the swings. The
basic
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
circuit is here: https://i.stack.imgur.com/jyZvD.gif D1 conducts when
Vin
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
is above VMax and D2 conducts then Vin is below Vmin. R limits the
current.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
I typically put a second resistor after the clamp. I find that 1K for
both
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
works well with PIC inputs.
A couple of variations are helpful. If D1 and D2 are Schotty diodes
then
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
the voltage overshoot is typically only 0.3V or so. Also if D2 is a
Zener
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
then D1 is unnecessary because the Zener action will limit the high
voltage
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
while normal conduction clamps the low voltage.
With the signal inverted there are a few things you can do to manage
it.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
I've been using PIC24FV parts for several years. The hardware EUARTS on
them can be inverted in software. It is also possible to bit bang a
digital
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
input/output for serial. Otherwise a NPN transistor whose base is
connected
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
to Vout, emitter grounded, and a pullup collector will invert the
signal in
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
hardware.
Another thought that may be traitorous on this board: ever considered
an
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Arduino? Complete boards with the USB serial adapter on board clock in
at
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
about $5 USD. Boards like a Nano will plug right into a breadboard.
Plug in
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
a USB cable, load the Arduino IDE and you're going literally in about 5
minutes. Tons of libraries already built into the platform.
As I've progressed in the hobby, I find that sometimes it's just more
trouble than it's worth to try to roll everything from scratch. Back
in the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
PIC 16C54 days, the price and functionality was a compelling reason to
switch as compared to the alternatives. But in 2017 with high level
boards
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
such as a Raspberry PI Zero W that runs Linux and having a complete wireles setup
for less than $10 USD and Arduino clones literally running 5 for $20,
it
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
becomes more difficult to justify wiring up a board from scratch and
programming in assembly anymore. Those who have never done it may need
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
experience. But those of us who have a closetfull of t-shirts with
'Assembly coder' emblazoned upon them? Not so much. I find now that I
spend
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
more time and energy trying to match the hardware/firmware to the
application. It literally may be more adventageous to throw a RasPi
ZeroW
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
into a problem to make a wireless remote light switch than any
alternative
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
for
example.
BAJ
Post by Anthony Nixon
You wont need a level translator with the FTDI chip. It will directly
interface to the PIC, and the FTDI directly interfaces to the USB port
with the right support components which are just a handful of
passives.
The trick is whether or not the FTDI will be powered by the USB port
or by the PIC circuit.
cheers
Tony
On Tue, Nov 14, 2017 at 11:56 PM, Richard Pope <
Clint,
I'll do that this evening after I get up. I appreciate the
insight
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART
enabled mid
Post by Anthony Nixon
Post by Clint Jay
range devices so there should be plenty of example code to examine
and
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
PIC. I just found out that all that I need to do is treat the
connection
Post by Anthony Nixon
Post by Clint Jay
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would
suggest
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
that
Post by Anthony Nixon
Post by Clint Jay
you're going to connect your PIC to the PC with an FTDI USB to
serial
Post by Anthony Nixon
Post by Clint Jay
device?
Or have I misunderstood and you're hoping to connect the PIC to
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
FTDI
Post by Anthony Nixon
Post by Clint Jay
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC
18F4520.
Post by Anthony Nixon
Post by Clint Jay
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration
Code to
Post by Anthony Nixon
Post by Clint Jay
a 24C512 serial EPROM. When I add additional devices I want to be
able
Post by Anthony Nixon
Post by Clint Jay
to update the EPROM. I also want to be able to use a Win 8.1 64bit
Pro
Post by Anthony Nixon
Post by Clint Jay
PC to control the Programmer. I also do a lot of searching and
research
Post by Anthony Nixon
Post by Clint Jay
on materials that I acquire from the MicroChip website. I have
been
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest
versions of
Post by Anthony Nixon
Post by Clint Jay
the X8, X18, and X32 Compilers installed. I also see that I need
to
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
install the latest versions of C30 C and C18 C Compilers and setup
the
Post by Anthony Nixon
Post by Clint Jay
proper Paths for these files. I don't mind doing the footwork. I
am
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus
software.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Byron A. Jeff
Associate Professor: Department of Computer Science and Information Technology
College of Information and Mathematical Sciences
Clayton State University
http://faculty.clayton.edu/bjeff
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Clint.
*No trees were harmed in the sending of this mail. However, a large
number
Post by James Cameron
Post by Clint Jay
of electrons were greatly inconvenienced.*
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Richard Pope
2017-11-15 06:01:09 UTC
Permalink
Chris,
I'll look in to it. Did you read my latest post on the the forum
about an idea to replace the relays with 74LS244N s and 74LS32Ns?
GOD Bless and Thanks,
rich!
Post by Chris Roper
Take a look at http://gcbasic.com/
It is a compiler, it supports your device, has drivers / examples for most
of what you have mentioned, is far easier than Assembler or C and is free.
To set up a serial connection via FTDI and control an LCD is only about
half a dozen lines of code in GCBASIC.
I also find that the code it generates is far better optimized than XC8
code.
It is a great way to get started but is by no means confined only to
beginners it had some very advanced capabilities, supports over 1100 chips
from the PIC and AVR families with full portability.
Cheers
Chris
Post by Richard Pope
Hello James, Jeff, Tony,
I considered the Arduino and the ATMEGA32 but I needed a lot of I/O
and I don't need CPP or Analog. Yes, there is more support for the
Arduino but there is a lot out there for the PIC. I could use some more
I/O pins. I am using shift registers to control the address lines going
to the programming socket and a 8 to 3 encoder chip for the interrupts.
The FTDI chip that I am considering is a FT232RL. It will be
connected to the PIC in a direct manner and only the USB side will be
able to connect to a PC. I know that the RS232 port on the PIC swings 0
to 5 volts. I'll have to check the datasheet for the FT232RL to see if
it swings 0 to 3.3 or 5 volts. I don't know.
I use C to do my coding. I understand Assembly to a certain point.
I am able to follow along the code and see what is going on but I have a
difficult time creating my own Assembly programs. I am going to run the
4520 at 40MHz so speed isn't going to be a big issue for the programmer.
Right now I am using relays to switch the Address lines and various
programming voltages to the appropriate pins on the programming socket.
I found a program for controlling a LCD on the MC website. The
only problem is that I can't find where that Data Pins are being
defined. I found the definitions for the control lines.
Thanks,
rich!
Post by James Cameron
Thanks for the STM32 Blue Pill reference. An interesting looking board.
Post by Clint Jay
Jeff, you raise good points but I would prefer to be safe than sorry,
designing/building and coding for the MAX232 or other serial driver will
ensure compatibility (as far as RS-232 is able to be compatible) with
the
Post by James Cameron
Post by Clint Jay
widest range of PCs and prevent anything 'unpleasant' happening if the
device is plugged into an unknown machine.
As heretical as it would seem I'd have to admit you may have a point
about
Post by James Cameron
Post by Clint Jay
Arduino, it's a known hardware platform that is proven to work.
Similarly, I've been exploring options with STM32 Blue Pill boards
recently
Post by James Cameron
Post by Clint Jay
but I still like and write code for PIC devices, as and when I need
extra
Post by James Cameron
Post by Clint Jay
horsepower I may well leave the PIC Path and move to ARM, they're *so*
cheap and have an abundance of facilities.
Post by Byron Jeff
Tony,
There are actually two types of FTDI serial ports. There is the RS232
one
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
with a DB9 connector on the end. Typically that port will signal
between
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
+/- 7 volts or so. Then there are the small FTDI TTL serial adapters.
Depending on configuration they will swing either between 0 and 5
volts or
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
0 and 3.3 volts.
In today's serial PC world rarely does an actual MAX232 need to be
used for
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
level translation. Even with actual RS232 ports, virtually all of them
signal properly with a 0/5V TTL signal. Note that the sign is inverted
such
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
that a logical 1 is represented by 0V and a zero by 5V.
For years I've used a simple voltage clamp to limit the swings. The
basic
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
circuit is here: https://i.stack.imgur.com/jyZvD.gif D1 conducts when
Vin
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
is above VMax and D2 conducts then Vin is below Vmin. R limits the
current.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
I typically put a second resistor after the clamp. I find that 1K for
both
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
works well with PIC inputs.
A couple of variations are helpful. If D1 and D2 are Schotty diodes
then
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
the voltage overshoot is typically only 0.3V or so. Also if D2 is a
Zener
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
then D1 is unnecessary because the Zener action will limit the high
voltage
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
while normal conduction clamps the low voltage.
With the signal inverted there are a few things you can do to manage
it.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
I've been using PIC24FV parts for several years. The hardware EUARTS on
them can be inverted in software. It is also possible to bit bang a
digital
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
input/output for serial. Otherwise a NPN transistor whose base is
connected
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
to Vout, emitter grounded, and a pullup collector will invert the
signal in
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
hardware.
Another thought that may be traitorous on this board: ever considered
an
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Arduino? Complete boards with the USB serial adapter on board clock in
at
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
about $5 USD. Boards like a Nano will plug right into a breadboard.
Plug in
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
a USB cable, load the Arduino IDE and you're going literally in about 5
minutes. Tons of libraries already built into the platform.
As I've progressed in the hobby, I find that sometimes it's just more
trouble than it's worth to try to roll everything from scratch. Back
in the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
PIC 16C54 days, the price and functionality was a compelling reason to
switch as compared to the alternatives. But in 2017 with high level
boards
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
such as a Raspberry PI Zero W that runs Linux and having a complete wireles setup
for less than $10 USD and Arduino clones literally running 5 for $20,
it
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
becomes more difficult to justify wiring up a board from scratch and
programming in assembly anymore. Those who have never done it may need
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
experience. But those of us who have a closetfull of t-shirts with
'Assembly coder' emblazoned upon them? Not so much. I find now that I
spend
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
more time and energy trying to match the hardware/firmware to the
application. It literally may be more adventageous to throw a RasPi
ZeroW
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
into a problem to make a wireless remote light switch than any
alternative
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
for
example.
BAJ
Post by Anthony Nixon
You wont need a level translator with the FTDI chip. It will directly
interface to the PIC, and the FTDI directly interfaces to the USB port
with the right support components which are just a handful of
passives.
The trick is whether or not the FTDI will be powered by the USB port
or by the PIC circuit.
cheers
Tony
On Tue, Nov 14, 2017 at 11:56 PM, Richard Pope <
Clint,
I'll do that this evening after I get up. I appreciate the
insight
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART
enabled mid
Post by Anthony Nixon
Post by Clint Jay
range devices so there should be plenty of example code to examine
and
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC to
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
PIC. I just found out that all that I need to do is treat the
connection
Post by Anthony Nixon
Post by Clint Jay
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would
suggest
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
that
Post by Anthony Nixon
Post by Clint Jay
you're going to connect your PIC to the PC with an FTDI USB to
serial
Post by Anthony Nixon
Post by Clint Jay
device?
Or have I misunderstood and you're hoping to connect the PIC to
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
FTDI
Post by Anthony Nixon
Post by Clint Jay
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC
18F4520.
Post by Anthony Nixon
Post by Clint Jay
I am going to use a FTDI USB to RS232 converter to talk to the PIC
18F4520 Through the RX and TX Pins. I want to send Configuration
Code to
Post by Anthony Nixon
Post by Clint Jay
a 24C512 serial EPROM. When I add additional devices I want to be
able
Post by Anthony Nixon
Post by Clint Jay
to update the EPROM. I also want to be able to use a Win 8.1 64bit
Pro
Post by Anthony Nixon
Post by Clint Jay
PC to control the Programmer. I also do a lot of searching and
research
Post by Anthony Nixon
Post by Clint Jay
on materials that I acquire from the MicroChip website. I have
been
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest
versions of
Post by Anthony Nixon
Post by Clint Jay
the X8, X18, and X32 Compilers installed. I also see that I need
to
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
install the latest versions of C30 C and C18 C Compilers and setup
the
Post by Anthony Nixon
Post by Clint Jay
proper Paths for these files. I don't mind doing the footwork. I
am
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus
software.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Byron A. Jeff
Associate Professor: Department of Computer Science and Information Technology
College of Information and Mathematical Sciences
Clayton State University
http://faculty.clayton.edu/bjeff
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Clint.
*No trees were harmed in the sending of this mail. However, a large
number
Post by James Cameron
Post by Clint Jay
of electrons were greatly inconvenienced.*
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Byron Jeff
2017-11-15 17:02:22 UTC
Permalink
Rich,

I didn't see it. But if you are working with CMOS chips like the PIC it's
almost always better to use chips in the HCT family for interfacing. The
reason is that the inputs work properly with TTL voltage levels while the
outputs are nearly rail to rail. So a 3.3V input will generate a 5V output.

BAJ
Post by Richard Pope
Chris,
I'll look in to it. Did you read my latest post on the the forum
about an idea to replace the relays with 74LS244N s and 74LS32Ns?
GOD Bless and Thanks,
rich!
[ Snipping... getting too long ]

BAJ
--
Byron A. Jeff
Associate Professor: Department of Computer Science and Information Technology
College of Information and Mathematical Sciences
Clayton State University
http://faculty.clayton.edu/bjeff
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Richard Pope
2017-11-15 21:23:48 UTC
Permalink
Bryan,
I appreciate the information. I'll change them to HCTs. My
understanding is that the HCTs don't have as much fan out ability. Is
this correct?
Thanks,
rich!
Post by Byron Jeff
Rich,
I didn't see it. But if you are working with CMOS chips like the PIC it's
almost always better to use chips in the HCT family for interfacing. The
reason is that the inputs work properly with TTL voltage levels while the
outputs are nearly rail to rail. So a 3.3V input will generate a 5V output.
BAJ
Post by Richard Pope
Chris,
I'll look in to it. Did you read my latest post on the the forum
about an idea to replace the relays with 74LS244N s and 74LS32Ns?
GOD Bless and Thanks,
rich!
[ Snipping... getting too long ]
BAJ
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Isaac M. Bavaresco
2017-11-15 22:29:26 UTC
Permalink
The HCTs work only with 5V VDD. They recognize 2V and higher as logic
high to be compatible with TTL outputs and they require also 5V TTL supply.

If your board is 3.3V only they won't work.

Cheers,

Isaac
Post by Richard Pope
Bryan,
I appreciate the information. I'll change them to HCTs. My
understanding is that the HCTs don't have as much fan out ability. Is
this correct?
Thanks,
rich!
Post by Byron Jeff
Rich,
I didn't see it. But if you are working with CMOS chips like the PIC it's
almost always better to use chips in the HCT family for interfacing. The
reason is that the inputs work properly with TTL voltage levels while the
outputs are nearly rail to rail. So a 3.3V input will generate a 5V output.
BAJ
Post by Richard Pope
Chris,
I'll look in to it. Did you read my latest post on the the forum
about an idea to replace the relays with 74LS244N s and 74LS32Ns?
GOD Bless and Thanks,
rich!
[ Snipping... getting too long ]
BAJ
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership op
Richard Pope
2017-11-15 22:36:31 UTC
Permalink
Issac,
The board is 3.3V, 5V 12.5V, and 27.5V. I appreciate this.
Thanks,
rich!
Post by Isaac M. Bavaresco
The HCTs work only with 5V VDD. They recognize 2V and higher as logic
high to be compatible with TTL outputs and they require also 5V TTL supply.
If your board is 3.3V only they won't work.
Cheers,
Isaac
Post by Richard Pope
Bryan,
I appreciate the information. I'll change them to HCTs. My
understanding is that the HCTs don't have as much fan out ability. Is
this correct?
Thanks,
rich!
Post by Byron Jeff
Rich,
I didn't see it. But if you are working with CMOS chips like the PIC it's
almost always better to use chips in the HCT family for interfacing. The
reason is that the inputs work properly with TTL voltage levels while the
outputs are nearly rail to rail. So a 3.3V input will generate a 5V output.
BAJ
Post by Richard Pope
Chris,
I'll look in to it. Did you read my latest post on the the forum
about an idea to replace the relays with 74LS244N s and 74LS32Ns?
GOD Bless and Thanks,
rich!
[ Snipping... getting too long ]
BAJ
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailm
RussellMc
2017-11-16 08:17:15 UTC
Permalink

Post by Chris Roper
Take a look at http://gcbasic.com/
It is a compiler, it supports your device, has drivers / examples for most
of what you have mentioned, is far easier than Assembler or C and is free.
To set up a serial connection via FTDI and control an LCD is only about
half a dozen lines of code in GCBASIC.
I also find that the code it generates is far better optimized than XC8
code.
It is a great way to get started but is by no means confined only to
beginners it had some very advanced capabilities, supports over 1100 chips
from the PIC and AVR families with full portability.
URL invalid

*Garglabet search GCBASIC
<https://www.google.co.nz/search?num=50&source=hp&ei=pUgNWq3qJYuc0gTQ_6f4Cw&q=gcbasic&oq=gcbasic&gs_l=psy-ab.3..0l4j0i30k1l6.1397.3145.0.5310.8.7.0.0.0.0.386.688.3-2.2.0....0...1.1.64.psy-ab..6.2.688.0...0.V11K26OkOgk>
*-
many relevant results

including

GCBASIC - Source Forge -
http://gcbasic.sourceforge.net/Typesetter/index.php/Home

http://www.greatcowbasic.com/

http://www.greatcowbasic.com/gcb.html

http://www.best-microcontroller-projects.com/pic-basic-gcbasic-ezine4.html


Russell




Post by Chris Roper
Cheers
Chris
Post by Richard Pope
Hello James, Jeff, Tony,
I considered the Arduino and the ATMEGA32 but I needed a lot of I/O
and I don't need CPP or Analog. Yes, there is more support for the
Arduino but there is a lot out there for the PIC. I could use some more
I/O pins. I am using shift registers to control the address lines going
to the programming socket and a 8 to 3 encoder chip for the interrupts.
The FTDI chip that I am considering is a FT232RL. It will be
connected to the PIC in a direct manner and only the USB side will be
able to connect to a PC. I know that the RS232 port on the PIC swings 0
to 5 volts. I'll have to check the datasheet for the FT232RL to see if
it swings 0 to 3.3 or 5 volts. I don't know.
I use C to do my coding. I understand Assembly to a certain point.
I am able to follow along the code and see what is going on but I have a
difficult time creating my own Assembly programs. I am going to run the
4520 at 40MHz so speed isn't going to be a big issue for the programmer.
Right now I am using relays to switch the Address lines and various
programming voltages to the appropriate pins on the programming socket.
I found a program for controlling a LCD on the MC website. The
only problem is that I can't find where that Data Pins are being
defined. I found the definitions for the control lines.
Thanks,
rich!
Post by James Cameron
Thanks for the STM32 Blue Pill reference. An interesting looking
board.
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Jeff, you raise good points but I would prefer to be safe than sorry,
designing/building and coding for the MAX232 or other serial driver
will
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
ensure compatibility (as far as RS-232 is able to be compatible) with
the
Post by James Cameron
Post by Clint Jay
widest range of PCs and prevent anything 'unpleasant' happening if the
device is plugged into an unknown machine.
As heretical as it would seem I'd have to admit you may have a point
about
Post by James Cameron
Post by Clint Jay
Arduino, it's a known hardware platform that is proven to work.
Similarly, I've been exploring options with STM32 Blue Pill boards
recently
Post by James Cameron
Post by Clint Jay
but I still like and write code for PIC devices, as and when I need
extra
Post by James Cameron
Post by Clint Jay
horsepower I may well leave the PIC Path and move to ARM, they're *so*
cheap and have an abundance of facilities.
Post by Byron Jeff
Tony,
There are actually two types of FTDI serial ports. There is the RS232
one
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
with a DB9 connector on the end. Typically that port will signal
between
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
+/- 7 volts or so. Then there are the small FTDI TTL serial adapters.
Depending on configuration they will swing either between 0 and 5
volts or
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
0 and 3.3 volts.
In today's serial PC world rarely does an actual MAX232 need to be
used for
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
level translation. Even with actual RS232 ports, virtually all of
them
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
signal properly with a 0/5V TTL signal. Note that the sign is
inverted
Post by Richard Pope
such
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
that a logical 1 is represented by 0V and a zero by 5V.
For years I've used a simple voltage clamp to limit the swings. The
basic
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
circuit is here: https://i.stack.imgur.com/jyZvD.gif D1 conducts
when
Post by Richard Pope
Vin
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
is above VMax and D2 conducts then Vin is below Vmin. R limits the
current.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
I typically put a second resistor after the clamp. I find that 1K for
both
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
works well with PIC inputs.
A couple of variations are helpful. If D1 and D2 are Schotty diodes
then
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
the voltage overshoot is typically only 0.3V or so. Also if D2 is a
Zener
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
then D1 is unnecessary because the Zener action will limit the high
voltage
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
while normal conduction clamps the low voltage.
With the signal inverted there are a few things you can do to manage
it.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
I've been using PIC24FV parts for several years. The hardware EUARTS
on
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
them can be inverted in software. It is also possible to bit bang a
digital
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
input/output for serial. Otherwise a NPN transistor whose base is
connected
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
to Vout, emitter grounded, and a pullup collector will invert the
signal in
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
hardware.
Another thought that may be traitorous on this board: ever considered
an
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Arduino? Complete boards with the USB serial adapter on board clock
in
Post by Richard Pope
at
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
about $5 USD. Boards like a Nano will plug right into a breadboard.
Plug in
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
a USB cable, load the Arduino IDE and you're going literally in
about 5
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
minutes. Tons of libraries already built into the platform.
As I've progressed in the hobby, I find that sometimes it's just more
trouble than it's worth to try to roll everything from scratch. Back
in the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
PIC 16C54 days, the price and functionality was a compelling reason
to
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
switch as compared to the alternatives. But in 2017 with high level
boards
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
such as a Raspberry PI Zero W that runs Linux and having a complete
wireles setup
for less than $10 USD and Arduino clones literally running 5 for $20,
it
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
becomes more difficult to justify wiring up a board from scratch and
programming in assembly anymore. Those who have never done it may
need
Post by Richard Pope
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
experience. But those of us who have a closetfull of t-shirts with
'Assembly coder' emblazoned upon them? Not so much. I find now that I
spend
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
more time and energy trying to match the hardware/firmware to the
application. It literally may be more adventageous to throw a RasPi
ZeroW
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
into a problem to make a wireless remote light switch than any
alternative
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
for
example.
BAJ
Post by Anthony Nixon
You wont need a level translator with the FTDI chip. It will
directly
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
interface to the PIC, and the FTDI directly interfaces to the USB
port
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
with the right support components which are just a handful of
passives.
The trick is whether or not the FTDI will be powered by the USB port
or by the PIC circuit.
cheers
Tony
On Tue, Nov 14, 2017 at 11:56 PM, Richard Pope <
Clint,
I'll do that this evening after I get up. I appreciate the
insight
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
and help! I will probably have to use a MAX232 to do the level
translation. I appreciate you reminding me of that.
Thanks,
rich!
Post by Clint Jay
There may be, I've usually just rolled my own routines to service
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
EUSART though I haven't used the '4520 specifically.
I don't think there are huge differences between most EUSART
enabled mid
Post by Anthony Nixon
Post by Clint Jay
range devices so there should be plenty of example code to examine
and
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
modify for your needs.
You'll need a level translator if you're going PIC to PC directly.
Clint,
Yes, I am using a FTDI to RS232 converter to hook the PC
to
Post by Richard Pope
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
PIC. I just found out that all that I need to do is treat the
connection
Post by Anthony Nixon
Post by Clint Jay
to the PIC as a Serial connection. Is there a MC Serial Library
available? I'm the one that was confused.
Thanks,
rich!
I'm a little confused but the way I read your message would
suggest
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
that
Post by Anthony Nixon
Post by Clint Jay
you're going to connect your PIC to the PC with an FTDI USB to
serial
Post by Anthony Nixon
Post by Clint Jay
device?
Or have I misunderstood and you're hoping to connect the PIC to
the
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
FTDI
Post by Anthony Nixon
Post by Clint Jay
with USB?
HELLO ALL,
. . . . I could really use some help with using USB on the PIC
18F4520.
Post by Anthony Nixon
Post by Clint Jay
I am going to use a FTDI USB to RS232 converter to talk to the
PIC
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
18F4520 Through the RX and TX Pins. I want to send Configuration
Code to
Post by Anthony Nixon
Post by Clint Jay
a 24C512 serial EPROM. When I add additional devices I want to
be
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
able
Post by Anthony Nixon
Post by Clint Jay
to update the EPROM. I also want to be able to use a Win 8.1
64bit
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Pro
Post by Anthony Nixon
Post by Clint Jay
PC to control the Programmer. I also do a lot of searching and
research
Post by Anthony Nixon
Post by Clint Jay
on materials that I acquire from the MicroChip website. I have
been
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
reading the MC USB Device Firmware Framework User's Guide.
. . . . I have the latest version of MpLab, and the latest
versions of
Post by Anthony Nixon
Post by Clint Jay
the X8, X18, and X32 Compilers installed. I also see that I need
to
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
install the latest versions of C30 C and C18 C Compilers and
setup
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
the
Post by Anthony Nixon
Post by Clint Jay
proper Paths for these files. I don't mind doing the footwork. I
am
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
Disabled and retired. This gives me a lot of free time.
Thanks,
Richard R. Pope
1230 19th Street #5
Reedsburg, WI 53959, USA
1-608-768-7448
---
This email has been checked for viruses by Avast antivirus
software.
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
https://www.avast.com/antivirus
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list
archive
Post by Richard Pope
Post by James Cameron
Post by Clint Jay
Post by Byron Jeff
Post by Anthony Nixon
Post by Clint Jay
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Byron A. Jeff
Associate Professor: Department of Computer Science and Information Technology
College of Information and Mathematical Sciences
Clayton State University
http://faculty.clayton.edu/bjeff
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Clint.
*No trees were harmed in the sending of this mail. However, a large
number
Post by James Cameron
Post by Clint Jay
of electrons were greatly inconvenienced.*
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mi
Chris Roper
2017-11-16 08:32:38 UTC
Permalink
Thanks Russell,

I have contacted the admin to let him know it is down, the domain was only
registered on Saturday so may be having teething troubles.
Of the alternatives you posted http://gcbasic.sourceforge.
net/Typesetter/index.php/Home is the officail one and the one that the
GCBASIC.com address was pointing too.

Cheers
Chris


URL invalid
Post by RussellMc
Russell
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Chris Roper
2017-11-16 10:26:41 UTC
Permalink
http://gcbasic.com/ is back online, thanks for pointing it out.
Post by Chris Roper
Thanks Russell,
I have contacted the admin to let him know it is down, the domain was only
registered on Saturday so may be having teething troubles.
Of the alternatives you posted http://gcbasic.sourceforge.net/Typesetter/
index.php/Home is the officail one and the one that the GCBASIC.com
address was pointing too.
Cheers
Chris
URL invalid
Post by RussellMc
Russell
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Trevor Hancock
2017-11-16 07:10:27 UTC
Permalink
Hello, I am replying to the digest version of the list

I have recently gone through the process of communicating via serial
using a logic level ftdi - usb adapter, but with an older chip the
18F452, I am revisiting an old project.

I wanted to try mplabx so I have been porting from another compiler that
had some quirks I didn't want to deal with again.

Others have said the MCC (code configurator)  made things easy but the
older parts are not supported including the '452 and '4520.

There is a microchip library (plib) for mplab that supports the older
chips but is not included with xc8 download but can be downloaded and
installed separately.

I also found a 3 year old library that implements the arduino style
Serial.print() functions in mplabx but that took a lot of reworking to
make it work in the current mplabx and xc8 compiler.

My application will communicate to the serial port of a Raspberry Pi
through a 3v to 5v level converter, and parse json from a webapp to
control the original hardware.

If anyone is interested I am fine with posting my test code (messy - no
error checking or fault tolerance).

Where is the best place to post it? Too many lines of code might get
unwieldy for this list.

Regards
Trevor H
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailma
Loading...