Comments (4)
- Yes. The kernal routines should work fine. The sample disk that comes with the firmware uses the kernal in both BASIC (in some examples) and ML (in most).
- You'll have to compare the pin assignments of your schematic with ours to answer that first question.
2a. No, the C64 kernal does not manage hardware handshaking, you need to do that by hand. The typical way is to watch the two buffer index registers to see how full or empty the buffer is, and alter the UP pins accordingly. - AFAIK, the kernal doesn't manage software handshaking either. Also needs to be done manually. I've tried SWHS in programs like Novaterm in ATF1 mode, and it definitely works. Novaterm can also prove hardware HS as well.
- Can't help you there, man., as I only program Commodore software on Commodore computers (and then use a conversion tool to publish on github).
from zimodem.
Oh, the earlier problem definitely sounds like a baud rate issue, but it might also be a buffer overflow issue? It's hard to say from way over here.
from zimodem.
Thanks... Buffer issues are unlikely, my little TCP test service sends only a few bytes.
But my current assumption is that the code generated by cc65 somehow meddles around with interrupts or timing, conflicting with the kernal serial routines. I'll investigate in that direction.
from zimodem.
I made some progress, maybe someone will find this helpful:
I had no success with using the Kernal routines from my C program. I also had issues from BASIC; while INPUT# works fine, repeatedly calling GET# also returned garbled characters.
Then I found a serial driver for cc65 at https://github.com/nanoflite/c64-up2400-cc65.
The catch: it only supports 2400baud. It apparently also only works if the Kernal serial routines have not been initialized, so I was unable to switch Zimodem from 1200 to 2400baud "on the fly" first.
I thus switched my board to 2400baud permanently via the USB terminal on my PC (open serial monitor with 1200baud, enter ATB2400
, switch to 2400baud, then enter AT&W
to save permanently).
Now this little program works:
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <serial.h>
#include <string.h>
void test_port()
{
/* Warning: c64-up2400 _only_ supports 2400baud (source:
https://modelrail.otenko.com/electronics/commodore-64-serial-interface-to-arduino) */
const struct ser_params sp = {SER_BAUD_2400, SER_BITS_8, SER_STOP_1, SER_PAR_NONE, SER_HS_NONE};
unsigned char i = 0;
const unsigned char *cmd = "ATI5\r\n";
unsigned char rc = 0;
unsigned char c = 0;
printf("Loading driver...");
rc = ser_load_driver("c64-up2400.ser");
printf("Result: %u\n", rc);
if (rc != 0)
{
printf("Loading failed, aborting.");
/* check if the driver is on your floppy with the correct name:
c64-up2400.ser (all caps on LOAD"$",8) */
return;
}
// open serial port
rc = ser_open(&sp);
printf("ser_open rc=%u\n", rc);
// enable serial (Source: http://www.cbmstuff.com/forum/printthread.php?tid=353)
rc = ser_ioctl(1, NULL);
printf("ser_ioctl rc=%u\n", rc);
// send some command
i = 0;
do
{
do
{
rc = ser_put(cmd[i]);
if (rc == SER_ERR_OVERFLOW)
{
printf("overflow\r");
}
} while (rc == SER_ERR_OVERFLOW);
++i;
} while (cmd[i] != 0);
printf("sent %s\n", cmd);
// read response
while (1)
{
rc = ser_get(&c);
if (rc != SER_ERR_NO_DATA)
{
printf("%c", c);
//printf("Got: %c (0x%02x)\r", c, c);
}
}
}
void main()
{
test_port();
}
Cheers,
Martin
from zimodem.
Related Issues (20)
- 3.7 firmware and bbs host, echo enabled by default? HOT 3
- Can't compile: error: no return statement in function returning non-void [-Werror=return-type] HOT 3
- Feature request: additional user-provided HTTP headers and body for AT&G HOT 1
- Arduino sys/socket.h: No such file or directory HOT 3
- collect2.exe: error: ld returned 1 exit status HOT 2
- brand new compile, undefined reference HOT 5
- Prestel / Viewdata Terminal support HOT 1
- missing terminfo HOT 2
- build error, variables not declared in this scope (DEFAULT_DCD_HIGH) HOT 1
- RI (Ring Indicate) signal transition to quick HOT 1
- RS232_INVERTED confusion HOT 1
- Error during compliation HOT 1
- Help Command broken HOT 2
- Uploading Binary files HOT 2
- SPI input enhancement HOT 1
- does not support SGA HOT 1
- ESP32 - build successful but after reboot does not go beyond Init Complete HOT 1
- Failing build fix HOT 1
- Zimmerman-Zimodem/zimodem/src/libssh2/libssh2_priv.h:108:11: fatal error: sys/socket.h: No such file or directory HOT 3
- how to disable ATT debug? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zimodem.