ports and busses in teensyduino

Status
Not open for further replies.

nagual

Well-known member
hi,
is there some sort of reference material about creating "ports" with a teensy?
i am told that i want to create a serial bus out of a certain number of pins.
is this a standard arduino tactic that can be used on any arduino microprocessor?
 
Sorry, not sure what you are asking here? Or for which Teensy?

If you are simply wanting to do some Serial communications, you are probably always better off using a hardware serial port (UART) if one is available.

If you are using a Teensy 2.x - and need an additional Serial port, you should look up libraries like SoftwareSerial. There are a few different varieties out there. Most of them are setup mainly to work with AVR8 processors like which are used in the Teensy 2, or Arduino UNO...

If you are using any of the Teensy 3 or LC boards, they have a minimum of 3 hardware serial ports. These hardware Serial ports are fixed to specific pins on the boards, which you can see on the documentation for the specific board you are considering. Many of these have alternative pins that can also be used. On the documentation card that ships with the boards these are typically marked in a lighter colored font...

I believe the default SoftwareSerial library for the Teensy3s/lC - are setup to only work with the hardware Serial pins. Not sure if there are any alternative libraries setup to do bit banging over random IO pins for this. I have done it in the past for output only, but can be problematic.
 
Sorry, not sure what you are asking here? Or for which Teensy?

i have a 3.1 and a 2.0++ that i bought to drive a synth chip. i didn't get it off the ground yet, but I was told that i could make my code simpler by using ports. i can find what pins go to what port, but what i don't know is how to activate one of those ports.

If you are using a Teensy 2.x - and need an additional Serial port, you should look up libraries like SoftwareSerial.

ok, noted.


I believe the default SoftwareSerial library for the Teensy3s/lC - are setup to only work with the hardware Serial pins. Not sure if there are any alternative libraries setup to do bit banging over random IO pins for this. I have done it in the past for output only, but can be problematic.

cool, learned a new phrase "bit banging" ... can't wait to use that term.
 
What I do not know is how to tell Teensy programmatically that it is to see a certain number of pins as a port. Maybe this is found in a user manual I don't know maybe this is somewhere in a wiki. At my knowledge level everything is really decentralized in terms of information so it is very very hard to to collect information and store it somehow in a manner that I could recall it when I need it.
 
how to tell Teensy programmatically that it is to see a certain number of pins as a port.

Maybe this can help?

https://forum.pjrc.com/threads/1753...-GPIO_PDIR-_PDOR?p=21228&viewfull=1#post21228

The schematic is the easiest way to see which pins belong to which ports.

https://www.pjrc.com/teensy/schematic.html

Ultimately all this stuff is documented in the reference manuals.

https://www.pjrc.com/teensy/datasheets.html

There are 2 important chapters. The "ports" chapter is about configuring the pins. The "gpio" chapter is how to control them once in GPIO mode. Make sure you read both. The GPIO stuff alone is not enough, since the pins can configure to many alternate functions and don't get controlled by GPIO until correctly configured.
 
ok thanks Paul! I guess I should have looked for manuals before I asked that have the vague memory of doing that before and nothing like that existed or I could be wrong but thanks. I'm looking forward to having my head screwed on straight about using a microprocessor for something tangible eventually.
 
Don't be too optimistic, the datasheets are very hard to read (for beginners).
Can you tell us more about your project or what you're trying to do ?
 
sending register changes to a ym2612 and probably other things. i created a doozy of a thread about it already a couple few years back.
 
Indeed, it looks like plain old-school parallel bus. The chip allows you to go slowly, since its timing is controlled by your pulses on RD & WR.

Diving into the complexities of GPIO registers is a terrible way to get such a project working. Do it the easy way first. Odds are that will be plenty fast enough. Don't make an easy project much harder.

If using Teensy 3.6 or even Teensy 3.2 with digitalWriteFast() or direct registers, the signals will probably end up TOO FAST for this ancient chip. You will almost certainly need some delays, since these sorts of old chips usually can't work with pulses less than 100 ns.
 
Status
Not open for further replies.
Back
Top