Replies: 10 comments 8 replies
-
That's an interesting problem. The following things come to my mind:
|
Beta Was this translation helpful? Give feedback.
-
Hi
If you have a cro make sure the UART pins on the micro are actually changing state. I have been caught by dud rs232 chips before.
Regards
Richard
Get BlueMail for Android
…On Oct 6, 2022, 3:14 AM, at 3:14 AM, 4yerba ***@***.***> wrote:
This is not related to stm8ef or stm8 microcontrollers in particular
but to microcontrollers in general.
I am seeking an informed, ubiased advice on how to proceed further with
my UART issue.
Here is the problem I face:
I have a microcontroller that runs a program (a Forth all in one
everything) and does it well.
I also have another microcontroller (same, big brand name and type)
that apears to be almost the same that is flashed with the same program
the reference one is but stubbornly refuses to respond to the UART
console input.
Electrically, both circuits are correct, with proper decoupling
capacitors, fed from the same power source, no mixed RX/TX and other
pins, pull ups/downs etc. and both micros are perfectly uperational
(tested with another image flashed and run).
Inernally, the micros are the same - memory map, same peripherals and
so on. All the data matches.
The only difference I have found between these two micros is a JTAG ID,
which differs but it's not used anywhere in the sorce code during any
stage of the process (compilation, assembly, flashing, running -
nowhere).
I have reviewed the datasheets for both of these micros, the user
manual, which is the same for both, and even compared the errata sheets
for both witch are separate but the same in all relevant parts. All
matches up.
Here is the mental challenge: how's that possible ?
The only plausible explanation I find (unconfirmed as of yet) is an
existence of an undoccumented feature as the "problematic" micro is
branded as a specialty (dedicated) chip that is licensed to run some IP
protected library the regular chip is not supposed to run.
I am totally guessing here but have a feeling that that's why the chips
have different JTAG ID that is probably used within the proprietary
library source code.
Any thoughts, suggestions on how to proceed with this puzzle ?
--
Reply to this email directly or view it on GitHub:
#452
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
A CRO is an abbreviation for cathode ray oscilloscope. If you don't have one, or access to one, you're doing it the hard way. A logic analyser might help, but that's cumbersome for just confirming the UART is working.
Regards
Richard
Get BlueMail for Android
On Oct 12, 2022, 8:03 PM, at 8:03 PM, 4yerba ***@***.***> wrote:
Hi,
What's a cro ?
Good point about the dud usb>uart converters but no, this is not the
case. I've thought of that also and used two of them, both verified and
perfectly functional elsewhere, different types (not just different
pieces of the same). I'll probably resort to a comparative work and
torture another chip of the same kind prior to performing step by step
debugging. I hate debuggers ;) Sounds stupid but I really do.
--
Reply to this email directly or view it on GitHub:
#452 (reply in thread)
You are receiving this because you commented.
Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
A different JTAG ID might point to a different mask revision of the same chip. |
Beta Was this translation helpful? Give feedback.
-
I hadn't twigged to that. While I rarely use pics, though I sometimes reprogram a commercial product with flashforth, it's good to know. Given the chip shortages, that manufacturer might have pressed anything into service recently so I'm glad to hear about the Chinese efforts to help 😜
Thanks.
Get BlueMail for Android
On Nov 2, 2022, 10:59 AM, at 10:59 AM, sbridger ***@***.***> wrote:
A different JTAG ID might point to a different mask revision of the
same chip.
PICs for example have a chip rev #, which is a dead giveaway that the
Chinese have relabelled 15 year old chips as 2 years old. (I got
PIC16F628A's from 5 different Aliexpress suppliers. All were old mask
revs that had been relabelled)
Microchip publishes a separate errata sheet for each part. i.e errata
are not in the datasheets.
--
Reply to this email directly or view it on GitHub:
#452 (comment)
You are receiving this because you commented.
Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@VK6TT BTW, have you made a word to fully sleep, and wake on UART? |
Beta Was this translation helpful? Give feedback.
-
Yes.
I did the following:
$5235 CONSTANT UART_CR2
: Someword
[ $00 UART_CR2 ]c! \ disables both Rx and Tx
;
However, when trying to remember what I had done I had cause to look at
the STM8 Reference Manual.
It seems that you could also do the following which could be better from
a power consumption perspective but I haven't tested this:
$5234 CONSTANT UART_CR1
: Someword
[ $01 UART_CR1 $05 ]B! \ explicitly also disables UART prescaler
;
…On 2/11/2022 11:53 am, sbridger wrote:
@VK6TT <https://github.com/VK6TT> BTW, have you made a word to fully
sleep, and wake on UART?
I just put some RX antennas down the bank, and they might need a
remote switch soon. I want all clocks off in idle.
—
Reply to this email directly, view it on GitHub
<#452 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE7PE24CLRHEKRBSGVOZGELWGHQTRANCNFSM6AAAAAAQ525YPQ>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Apologies, I mis-read your message.
No, I have not written a word that sleeps and then wakes on a UART input.
I have slept, then woken on a key-press. I think you'll have to turn off
the UART, set the pin to input with perhaps a pull-up, then wait for a
change in the edge. Then wake-up and turn the UART on. I had a button
connected to PA2, press to ground pin. My approach was to put the STM8
into Halt ( or sleep) until the key was pressed. Rather than pickup from
where the code stopped I simply forced a cold start because I had no
need to restore the state prior to sleeping. I could have put the button
on the reset line but I chose to use PA2 since I was using button
presses when the device was awake for user input.
\ on rst EXTI_CR1 is $00 = falling edge and low level all inputs
\ this works since PA2 has pull-up on
: SLEEP \ effectively turn off
$0 AWU_TBR C! \ reduce power consumption
[ 1 PA_CR2 _MUT ]B! \ enable ext int.
[ $8E C, ] \ the HALT instruction
;
\ EXTI0 handler, forces power on reset
:NVM \ interrupt handler, "headerless" code
SAVEC
$80 WWDG_CR C! \ lets force a power on reset
IRET
;NVM ( xt ) EXTI0 !
…On 2/11/2022 12:47 pm, Richard Burden wrote:
[ $01 UART_CR1 $05 ]B!
|
Beta Was this translation helpful? Give feedback.
-
@sbridger maybe you should have a look at the link that I put in the reply yesterday - it's quite possible that it does what you need. |
Beta Was this translation helpful? Give feedback.
-
Yes, as always Thomas you're a step ahead of me. Good stuff.
Now I'm left trying to think of a suitable project to apply this to.
…On 3/11/2022 2:22 pm, Thomas wrote:
@sbridger <https://github.com/sbridger> maybe you should have a look
at the link that I put in the reply yesterday - it's quite possible
that it does what you need.
—
Reply to this email directly, view it on GitHub
<#452 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE7PE23HAMZU7B3JEFEWZ6DWGNKZFANCNFSM6AAAAAAQ525YPQ>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
This is not related to stm8ef or stm8 microcontrollers in particular but to microcontrollers in general.
I am seeking an informed, ubiased advice on how to proceed further with my UART issue.
Here is the problem I face:
I have a microcontroller that runs a program (a Forth all in one everything) and does it well.
I also have another microcontroller (same, big brand name and type) that apears to be almost the same that is flashed with the same program the reference one is but stubbornly refuses to respond to the UART console input.
Electrically, both circuits are correct, with proper decoupling capacitors, fed from the same power source, no mixed RX/TX and other pins, pull ups/downs etc. and both micros are perfectly uperational (tested with another image flashed and run).
Inernally, the micros are the same - memory map, same peripherals and so on. All the data matches.
The only difference I have found between these two micros is a JTAG ID, which differs but it's not used anywhere in the sorce code during any stage of the process (compilation, assembly, flashing, running - nowhere).
I have reviewed the datasheets for both of these micros, the user manual, which is the same for both, and even compared the errata sheets for both witch are separate but the same in all relevant parts. All matches up.
Here is the mental challenge: how's that possible ?
The only plausible explanation I find (unconfirmed as of yet) is an existence of an undoccumented feature as the "problematic" micro is branded as a specialty (dedicated) chip that is licensed to run some IP protected library the regular chip is not supposed to run.
I am totally guessing here but have a feeling that that's why the chips have different JTAG ID that is probably used within the proprietary library source code.
Any thoughts, suggestions on how to proceed with this puzzle ?
Beta Was this translation helpful? Give feedback.
All reactions