peg -
The Hong Kong team has looked into this again and believe that they have the solution.
They found that during USB enumeration, the reset pin on the JB16 is oscillating. They found that putting a capacitor of at least 330 nF from the reset pin to ground solved the problem. They also tried and are suggesting using 1uF as the 'production' value.
I haven't been able to actually try this here, but I'm passing it on so that you can try it. I will be building a couple of more boards in the next few days and plan to add this.
- Rocky
Hi Rocky,
I just discovered this oscillation on the reset pin about one hour ago, but rather than trying to kill it I have been trying to find the reason.
Here is what I have found:
Start a blank JB16.
Execution starts from the monitor mode reset vector at $FEFE which is $FE10.
0000FE10 A7FA AIS #$FA ;don't know
0000FE12 1100 BCLR 0,PORTA ;why?
0000FE14 CDFA07 JSR $FA07 ;jump to near top of MON ROM 1 to see if USB Monitor
;
0000FA07 070809 BRCLR 3,PORTE,*+12 ;abs = $FA13 branch if D+ low USBICP!!!!!
0000FA0A 3F38 CLR UADDR ;disable USB
0000FA0C 6EFF80 MOV #$FF,$80 ;RAM0 = $FF
0000FA0F 45FFF6 LDHX #$FFF6 ;TIM1 Int Vector
0000FA12 81 RTS
;
0000FA13 C6FFD0 LDA $FFD0 ;Check Ext Security 2 USBICP
0000FA16 4187F1 CBEQA #$87,*-12 ;abs = $FA0A No USB if sec2 set
0000FA19 9B SEI ;mask ints
blah, blah, blah
So very quickly after it starts it checks for USB D+ being low (which is the only condition required other than blank)
If it is low, it checks that the extended security has not been set then gets to address $FA19.
$FA19 is the entry point that is used by AN2399 and also where the OSBDM code jumps to if the PORTD bit 3 jumper is on.
Now the strange thing is if you jump to $FA19 from a user programme in FLASH everything works very reliably.
If you let it get there via the monitor code it doesn't.
Also jumping straight to $FE10 from a user programme works OK as well
The only pre-requisite is to disable the COP.
The reset pin is going low for a double pulse every 150us when entered via monitor entry.
A 0.1uf makes it all work for me. But why doesn't the problem occur when entered from user mode?
Here is my test programme:
ORG $BA00 ;start of FLASH
BRCLR 3,$03,COP ;if jumper on don't disable COP
MOV #%00000001,$1F ;disable COP
;COP JMP $FA19 ;jump to ICP entry in Monitor that AN2399 uses
COP JMP $FE10 ;jump to monitor entry point that blank reset vector uses
ORG $FFFE
DW $BA00 ;set reset vector to start of FLASH
BR Peg
HI,
yes i got that to work peg. if you still might need help...just post here again
mo
Hi mo,
Yes please, I still can never get blank part USB ICP to work.
I can programme it over MON08.
I can use it to programme something else.
I can bring it up into the ICP mode via grounding D3.
This is actually nearly exactly the same as the blank part startup after examining the monitor code.
Please let me know how you do it, although it may not help me as I am getting different reports from several places that its very flaky (getting it to boot into ICP mode).
BR Peg
Hi mo,
I am not sure if your understanding me.
I am talking about a JB16 either "out of the box" or "virgin" or a recently "mass erased" one. Then connecting it to a PC via just a USB cable (no special programmer) (no code in the flash).
BR Peg
Hi mo,
Thanks for your help.
I have got the ICP PC programme working etc. I can use it to do a mass erase after powering up a programmed OSBDM with the D3 link on.
What my problem is, is that I get device not recognised (by PC) when I power back up erased. I have the 1k5 removed and both USB lines pulled down.
Actually according to the monitor, you can leave the 1k5 in situ.
It appears to start to work as the internal pullup is applied but the computer doesn't recognise it now.
I am leaving my computer now so don't expect a reply for several hours.
BR Peg
Hi mo,
Sorry, the OSBDM (Open Source Background Debug Module) is what I am working on. It is a USB based programmer for 9S08 devices. The project is available here under the "8-bit Microcontroller Community" at the top right of this page. You may want to take a look at it.
D3 is bit 3 of PORTD and is the same as bit 0 PORTA in the AN2399 example.
I can do what you say about powering up with the link fitted and it works.
But if I mass erase it then power down. (perhaps accidently) now if I power back up with blank FLASH and USB D+ pulled to ground it should still come up like after the jumper is installed on a programmed device. But I and many others are having a problem here. It seems to be resolved now, see later in this thread.
Thanks, Peg
Message Edited by peg on 04-14-200603:52 PM
Hi Alban,
Rocky is following this up for me with Hong Kong.
Not sure why he only PM'd me about this.
BR Peg
Hi Mo,
I'm pretty sure the DRM055 is exactly what you are looking for.
This is a Reference Manual on how to use a QT and JB for USB Wireless keyboard...
Cheers,
Alban.