Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 15:00 29 Mar 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 : ELLO 1A with RTC

     Page 1 of 2    
Author Message
knivd

Regular Member

Joined: 07/09/2014
Location: United Kingdom
Posts: 71
Posted: 03:06pm 24 Apr 2021
Copy link to clipboard 
Print this post

Updated the website with firmware R112.

The I2C interface works and the system recognises RTC modules based on DS3231 (DS1307 should also work). Time is supported without RTC too, but of course, volatile. The <platform.h> library includes C.impl I2C functions, so things like a port expander on the I2C bus for example, are now possible.

A big portion of the work on this revision went into the keyboard (again). Now the DE and FR keyboards should work fine and handle the dead keys too (if anyone uses those, please test and let me know!). The UK and US layouts are with their extended versions, supporting the Alt characters as well.

There is also a rudimentary help system with the ./lsl command
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 05:22am 25 Apr 2021
Copy link to clipboard 
Print this post

I am not user of ELLO 1A. Did not have any interest in it. At least yet. )
But I liked the project.
And it's great to hear you are updating! Keep it up!
 
knivd

Regular Member

Joined: 07/09/2014
Location: United Kingdom
Posts: 71
Posted: 09:57am 25 Apr 2021
Copy link to clipboard 
Print this post

A little demo in text mode


#include <stdio.h>
#include <math.h>

void main(void) {
   double CA, CB, A, B, T;
   int n, X, Y, i;
   for(Y=-12; Y<13; Y++) {
       for(X=-39; X<39; X++) {
           CA = X * 0.0458;
           CB = Y * 0.08333;
           A = CA;
           B = CB;
           i = 0;
           n = 0;
           while(i<15) {
               T = A*A - B*B + CA;
               B = 2*A*B + CB;
               A = T;
               if((A*A + B*B) > 4) {
                   n = i + 48;
                   if(i>9) n += 7;
                   putchar(n);
                   break;
               }
               i = i + 1;
           }
           if(n==0) putchar(' ');
       }
   puts("\r");
   }
}
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 04:35pm 25 Apr 2021
Copy link to clipboard 
Print this post

I'm looking more closely into ELLO 1A specifications now.
Am I understanding the following correctly?

ELLO 1A uses the same chip as Micromite.
You managed to cram into 190K firmware:
- C interpreter
- PS/2 keyboard driver (borrowed from Geoff's ASCII Video Terminal)
- VGA monochrome driver (borrowed from Geoff's ASCII Video Terminal)
- SD card driver
- USB console (borrowed from Alan's M-Stack)

This is very impressive!


PS: There is two PS/2 connectors in the schematics (kbd & exp), but why is there none of them on the PCB?
 
knivd

Regular Member

Joined: 07/09/2014
Location: United Kingdom
Posts: 71
Posted: 05:53pm 25 Apr 2021
Copy link to clipboard 
Print this post

Yes, that is correct. Of course, the keyboard driver and video are to a large extent rewritten now to fit the needs of the project, but the basis came from Geoff's Terminal. The C interpreter takes up the biggest chunk in the flash with about 100k in total (that's including the libraries).
Both PS2 connectors are on the PCB. Refer to the pictures I posted in an earlier topic.
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 07:14pm 25 Apr 2021
Copy link to clipboard 
Print this post

I'm definetely missing something out, since I don't see PS/2 connectors here: http://ello.cc/pages/doc_files/image001.jpg
 
knivd

Regular Member

Joined: 07/09/2014
Location: United Kingdom
Posts: 71
Posted: 07:27pm 25 Apr 2021
Copy link to clipboard 
Print this post

 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 02:47am 26 Apr 2021
Copy link to clipboard 
Print this post

VGA PS/2 combo! That's what I missed. Haha! )
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 812
Posted: 02:26pm 28 Apr 2021
Copy link to clipboard 
Print this post

My Teraterm was probably too old. I now have no more problems with system crashes after I updated to Teraterm 4.105. However, I have trouble with the arrow keys:

R112a (C) Apr 2021, KnivD
[usb][kbd][vid]

Video  RAM: 19200 bytes
System RAM: 33008 bytes
Kbd layout: DE



Use .? for information


 3\ [C[C[C[D[A[D[B[D





Frank
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 02:38pm 28 Apr 2021
Copy link to clipboard 
Print this post

TeraTerm sends 3-byte escape sequences <Esc> (chr$(27) in Basic terms), "[", then

"A" signifies up arrow
"B" down arrow
"C" right arrow
"D" left arrow
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
knivd

Regular Member

Joined: 07/09/2014
Location: United Kingdom
Posts: 71
Posted: 07:09pm 28 Apr 2021
Copy link to clipboard 
Print this post

I am sorry, but I was unable to replicate this problem. ELLO handles the standard VT100 escape sequences along with the Windows scan codes. On my Tera Term v4.104 everything works normal. I also double checked with Putty.
My suspicion is that your keyboard map file might be different.
Tera Term comes with a small program called keycode.exe (in its directory). This program allows you to configure your keyboard map file in teram term according to your own system.
The keyboard files are in Tera Term menu Setup->Load Key Map



PS. I made a small change which I hope might help. Updated on the website
Edited 2021-04-29 17:19 by knivd
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 812
Posted: 11:46am 29 Apr 2021
Copy link to clipboard 
Print this post

It seems to be the "Transmit delay".
Since I often have trouble inserting characters via the clipboard, I changed the times:

Transmit delay
0 msec/char            5msec/line

...seems to work, but...
Transmit delay
5 msec/char            50msec/line

...(my default setting) causes problems!

Frank
 
knivd

Regular Member

Joined: 07/09/2014
Location: United Kingdom
Posts: 71
Posted: 12:30pm 29 Apr 2021
Copy link to clipboard 
Print this post

  Frank N. Furter said  It seems to be the "Transmit delay".
Since I often have trouble inserting characters via the clipboard, I changed the times:

Transmit delay
0 msec/char            5msec/line

...seems to work, but...
Transmit delay
5 msec/char            50msec/line

...(my default setting) causes problems!

Frank


Yes! The transmit delay would certainly cause a problem. The reason for that is the stupid way the escape sequences are built. They should have used a code which is not often used by a single key, such as Esc. So, to recognise whether it is single Esc key or a sequence, the software waits a little (1ms) to see if there will be another code coming, which might be (or may not!) an escape sequence. If there is nothing coming, or the following is not a valid continuation in an escape sequence, then it is assumed the Esc code is for a single escape key (which itself is a valid key in RIDE). Now, if you introduce a delay between every key code, then any esc code will be taken as a single key instead of a sequence.
I hope this explanation helps.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 812
Posted: 01:04pm 29 Apr 2021
Copy link to clipboard 
Print this post

Thank you for your explanation!!!

...but:
Didn't the Micromite and Maximite also work with escape sequences? I never had any problems with that...

Frank
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 02:02pm 29 Apr 2021
Copy link to clipboard 
Print this post

  Quote  Didn't the Micromite and Maximite also work with escape sequences? I never had any problems with that...

Timeout on the Micromite is 30mSec
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 812
Posted: 06:52pm 29 Apr 2021
Copy link to clipboard 
Print this post

Thanks Peter!
  Quote  Timeout on the Micromite is 30mSec

For char or line? I assume for char?

Frank
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 812
Posted: 07:15pm 30 Apr 2021
Copy link to clipboard 
Print this post

Strange behavior with RTC:

I MUST use a battery and I MUST DISCONNECT my keyboard for the first time - otherwise the RTC is not recognized!!!

Without battery the RTC is not recognized at all. With battery and keyboard connected, it is also not recognized the first time.
Only when I disconnect the keyboard and switch it on, the RTC is recognized. Even after I turned off ELLO and plugged the keyboard back in, the RTC is still recognized.
(I have exactly the same RTC as you! You should remove the charging resistor )



Do you have a small example of how I can query the time and date in a small program and display it on the monitor?

Thanks!

Frank
Edited 2021-05-01 05:19 by Frank N. Furter
 
knivd

Regular Member

Joined: 07/09/2014
Location: United Kingdom
Posts: 71
Posted: 07:35am 01 May 2021
Copy link to clipboard 
Print this post

I can make a reasonably safe bet that there might have been a bad contact problem with the RTC module during your first run. That was then settled when you disconnected the keyboard. There is absolutely no link between the PS/2 keyboard and the I2C bus. Not electrical and not in software.

You can set the time and date in RIDE with commands ./time and ./date, and see it with the .? command along with other information.

Here is a small program that gives you the time. It is literally following the communication as described in the DS3231 datasheet. There is only a small extra function needed for the BCD to binary conversion as all data to and from the RTC is in BCD format.


#include <stdio.h>
#include <platform.h>

int BCD2BIN(int bcd) {
   return (((bcd >> 4) * 10) + (bcd & 0x0F));
}

i2cStart();
i2cSend(0xD0);  // DS3231 write
i2cSend(0x00);  // register
i2cRepStart();
i2cSend(0xD1);  // DS3231 read
char sc = i2cRecv(0);
char mn = i2cRecv(0);
char hr = i2cRecv(1);
i2cStop();
printf("It is %02d:%02d:%02d\r\n", BCD2BIN(hr), BCD2BIN(mn), BCD2BIN(sc));
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 812
Posted: 10:19am 01 May 2021
Copy link to clipboard 
Print this post

  Quote  I can make a reasonably safe bet that there might have been a bad contact problem with the RTC module during your first run.


Sorry Kon! I have two RTC's and two ELLO's and it's reproducible...
When I remove the battery, the game starts all over again... (I also thought it would be the RTC but both systems behave identically!)

Thanks for your little program!
(How to set the time I have already found in your help! )

But... No matter what time I set, I always get the same time back (not the one I set). Setting the time and date do not seem to work    :

R112a (C) Apr 2021, KnivD
[usb][kbd][vid][rtc]

Video  RAM: 19200 bytes
System RAM: 33008 bytes
Kbd layout: DE




Use .? for information


.?
>>> HINT: Use command .H for help

Free memory: 32896 bytes
Current time: Sat Jan  1 15:32:31 2000
Current path: SD1:/

.... File name: ``
.. Find string: ``
Replace string: ``
1 lines, 1 bytes


./date 210430
.?
>>> HINT: Use command .H for help

Free memory: 32896 bytes
Current time: Sat Jan  1 15:32:46 2000
Current path: SD1:/

.... File name: ``
.. Find string: ``
Replace string: ``
1 lines, 1 bytes


 1:


Frank
 
knivd

Regular Member

Joined: 07/09/2014
Location: United Kingdom
Posts: 71
Posted: 10:38am 01 May 2021
Copy link to clipboard 
Print this post

I am sorry, but I really can't reproduce any problem which relates to the RTC and keyboard. Removing the battery will obviously reset the RTC. Quite normal.

Here is my session. Just ran it again with date and time. This is literally the first run after I removed and installed again the battery in the module, just for the test.
I really can't reproduce the problem you are seeing...


  Quote  
R112c (C) May 2021, KnivD
[usb][kbd][vid][rtc]

Video  RAM: 19200 bytes
System RAM: 30960 bytes
Kbd layout: UK



Use .? for information


./date 210501
./time 113030
.?
>>> HINT: Use command .H for help

Free memory: 30848 bytes
Current time: Sat May  1 11:30:33 2021
Current path: SD1:/

.... File name: ``
.. Find string: ``
Replace string: ``
1 lines, 1 bytes


 1:

 
     Page 1 of 2    
Print this page
© JAQ Software 2024