Is there anything connected (e.g. a USB connector for programming) to P3.0
and P3.1? Both IAP15W4K58S4 and STC8A8K64S4A12 seem to be able to switch
these pins to some kind of USB mode for programming. For STC8A8K64S4A12 the
manual mentions P3.2 needs to be at low level at powerup for this to work.

The IAP15W4K58S4 manual mentions both P3.2 and P3.3 in this context and the
Windows ISP screens show a programming option that also affects the UART1
pins.

I think the stgal documentation also mentions these programming options
under the option keys section.

https://github.com/grigorig/stcgal/blob/master/doc/USAGE.md

Unfortunately I do not have any of these microcontrollers, as otherwise I
would be happy to experiment a bit as well.

If not already done: maybe a very simple test like clearing P3.0 or P3.1
using the normal P3 register or direct bit access can show if the GPIO
function does work as expected?

 Eric


> -----Original Message-----
> From: Philipp Klaus Krause [mailto:p...@spth.de] 
> Sent: donderdag 11 juni 2020 16:45
> To: sdcc-user@lists.sourceforge.net
> Subject: Re: [Sdcc-user] STC8A8K64S4A12 UART?
> 
> Am 07.06.20 um 22:22 schrieb Philipp Klaus Krause:
> > Am 07.06.20 um 21:41 schrieb Eric Rullens:
> >> Just a wild guess after browsing the manual: the UART pins can be 
> >> selected via S1_S[1:0] in P_SW1, and this setting does not 
> seem to have a default?
> >>
> >>  Eric
> > 
> > Interesting find, but when I try explicitly setting it to 0, it it 
> > doesn't make a difference.
> > 
> > Philipp
> 
> Looks like I can't get the UART to work on IAP15W4K58S4 
> either, tried the following there (the IAP15W4K58S4 is being 
> calibrated to 24 Mhz):
> 
> #include <stdio.h>
> 
> __sfr __at(0x88) TCON;
> __sfr __at(0x89) TMOD;
> __sfr __at(0x8b) TL1;
> __sfr __at(0x8d) TH1;
> 
> __sfr __at(0x98) SCON;
> __sfr __at(0x99) SBUF;
> 
> int putchar(int c)
> {
>       while(!(SCON & 0x02));
>       SCON &= ~0x02;
>       SBUF = c;
>       return (c);
> }
> 
> void main(void)
> {
>       unsigned long int i = 0;
> 
>       // Configure UART for 9600 baud, 8 data bits, 1 stop bit.
>       TMOD = 0x20;
>       SCON = 0x40;
>       TH1 = 256 - 24.0 * 1000 * 1000 / 12 / 32 / 9600 + 0.5;
>       TCON |= 0x40;
>       SCON |= 0x02;                           // Tell 
> putchar() the UART is ready to send.
> 
>       for(;;)
>       {
>               printf("Hello World!\n");
>               for(i = 0; i < 147456; i++); // Sleep
>       }
> }
> 
> Philipp
> 
> 
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
> 


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to