Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 14:04 09 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Byte Wide Operations Using INP & OUT.

Author Message
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1310
Posted: 12:15pm 20 Jun 2011
Copy link to clipboard 
Print this post


I may be wrong, but it appears all I/O is done with single pins only.

What if we had two 10 bit wide ports, and used the old TRS-80 byte commands as follows:

INP(X) Inputs one byte from port number x.
OUTx,y Outputs byte y to port x.

Sure it's a 10 bit wide I/O port, but I don't think there is a problem, is there?

Cheers Don...

https://www.32v8.com/1
 
thetinkerer

Regular Member

Joined: 16/06/2011
Location: Australia
Posts: 68
Posted: 07:34pm 20 Jun 2011
Copy link to clipboard 
Print this post

I am with you on that one Don.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1310
Posted: 08:00pm 20 Jun 2011
Copy link to clipboard 
Print this post

  thetinkerer said   I am with you on that one Don.


If we can get another couple of supporters, I'll add it to the wish list.

Trouble is, I am not using the unit yet, and getting into the language, so I may be missing things at times.

Like the CLS. Someone said to me, hey, it hasn't got a CLS, so I added it to the wish list. I was wrong. It was staring me in the face, if I had read the manual a little more.

So two more positive comments on this one, and I'll add it to the Wish list.

I don't know how many items I can add to the poll. This may test it.
It may test Geoff too.

Cheers Don...
https://www.32v8.com/1
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 09:14pm 20 Jun 2011
Copy link to clipboard 
Print this post

Hey Don,

You have my support on that. It's actually something I had thought of earlier, but then forgot about.

Regards,

Bob Devries
Dalby, QLD, Australia
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 01:13am 21 Jun 2011
Copy link to clipboard 
Print this post

Don,

So you want to take an 8 bit value in a variable and send one bit to each of 8 ports?

That's already done in the LCD.BAS code. Admittedly it uses a call to a subroutine to do it, but once you have the subroutine you can ignore the complexity and just call it.

This is a bit like the RISC Vs CISC discussions of years past. If we can keep the core small we can add the routines we need, leaving memory for other stuff.

In hindsight this also covers my thought about having a SHIFT command. There's no real need for it, because we could use a subroutine to shift right by multiplying the value by 2, and shift left by dividing.
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 194
Posted: 01:32am 21 Jun 2011
Copy link to clipboard 
Print this post

Don, while there is a CLS, I think it would be nice if its functionality could be extended to the "serial" connection via USB. I realise that this would be dependant on the terminal emulator that one used being compatible with whatever escape sequence was sent by the CLS command. I think that it could also be assumed that everyone has access to a vt100/ANSI terminal emulator.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 01:39am 21 Jun 2011
Copy link to clipboard 
Print this post

Stuarts:
Regarding CLS to a terminal, the usual one would be CTRL-L CHR$(12), but that does nothing on the Maximite (as yet).

James_from_Canb:
I see your point about adding byte output. Adding commands to MMBasic which could fairly easily be done in BASIC subroutines, makes us lazy (IMHO). Doing some research on the subject usually provides clues on how to do it.

Regards,

Bob Devries
Dalby, QLD, Australia
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1310
Posted: 01:50am 21 Jun 2011
Copy link to clipboard 
Print this post


Thanks James and Bob, on the Byte wide commands.
I can see the double edged sword.

I'll leave it there, because it got there, and at least it should create a healthy discussion on the merits of each approach.

We don't do fisticuffs here yet, do we?

Cheers Don...


https://www.32v8.com/1
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1310
Posted: 01:58am 21 Jun 2011
Copy link to clipboard 
Print this post

  stuarts said   Don, while there is a CLS, I think it would be nice if its functionality could be extended to the "serial" connection via USB. I realise that this would be dependant on the terminal emulator that one used being compatible with whatever escape sequence was sent by the CLS command. I think that it could also be assumed that everyone has access to a vt100/ANSI terminal emulator.
Stuart


Sorry Stuart, I must have missed your point about CLS at our Special Meeting last night.

Does this mean that CLS won't always work on all Terminal Emulators, unless we throw the vt100/ANSI terminal code at it?

If you can rephrase the CLS, as a wish list question, I will add it to the list.

Cheers Don...
https://www.32v8.com/1
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 02:24am 21 Jun 2011
Copy link to clipboard 
Print this post

I have just examined the LCD.BAS file, and found that the output routine (lines 13000-13150) depends on the fact that any value other than 0 will drive a pin high (in digital mode) even a negative value!

If eight consecutive pins were toggled this way, I wonder what the time delay would be between pins and between first and last pins, and how important would this timing be?

I also just noticed that both the LOAD and KILL commands do NOT accept a directory name as part of the filename, again requiring a CHDIR before (and after) each use on a file in a directory other than the current working directory.

so, LOAD"dirname\prog.bas" doesn't work, you need to use CHDIR"dirname":LOAD"prog.bas":CHDIR".."

Regards,

Bob Devries
Dalby, QLD, Australia
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 08:39am 21 Jun 2011
Copy link to clipboard 
Print this post

  BobDevries said   I have just examined the LCD.BAS file, and found that the output routine (lines 13000-13150) depends on the fact that any value other than 0 will drive a pin high (in digital mode) even a negative value!

If eight consecutive pins were toggled this way, I wonder what the time delay would be between pins and between first and last pins, and how important would this timing be?


I think I recall the Maximite processing 30,000 instructions per second - so maybe 1/3000 of a second to write values to all 8 pins? The time taken doesn't matter for the LCD program because the values are loaded onto the 4 data pins then the pins 12 and 11 are toggles to accept the data.
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 11:02am 21 Jun 2011
Copy link to clipboard 
Print this post

MMBasic has a Timer command, so I can give you a real answer rather than estimating.
[note: I didn't actually wire up an LCD screen, but I ran the code.]

It takes 24 milliseconds to initialise the LCD screen, and 55 milliseconds to transmit the two lines of text to the LCD screen, including loading the values onto the pins.

Loading the 4 bits onto the pins and toggling pin 12 takes 1 millisecond.
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
muddy0409

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 125
Posted: 05:39am 22 Jun 2011
Copy link to clipboard 
Print this post

I have a possible application for this unit, however it requires reading a parallel 4 bit nibble to work, 18 times in reasonably quick succession. This may be possible if I map the 4 input lines to sucessive port pins, but I haven't stydied this yet.
Don't poo poo conspiracy theories.
Remember that everything ever discovered started somewhere as a theory.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024