Guys,
As some of you many know, I'm trying to fix a knackered MegaJolt for a friend. I've replaced the processor with one Brent sent but it still won't talk to the Java program or via HyperTerminal. So I tried re-programming it with the bootloader and megajolt code. This worked fine!
Any ideas why I can re-program it, but not upload maps to it? I'm thinking perhaps the oscillator's not functioning?
cheers
Matt Dearden
http://www.cate1.co.uk/megajolt
Comms wierdness
Moderators: JeffC, rdoherty, stieg, brentp
There is a communication
There is a communication chip on board, RS232something. That's the first thing you replace if communicatin don't function. Another thing, voltage you supply to the unit should be 12 volts, maybe 12.5, but not 9 volts off a 9 bolt battery.
If you still unable to fix it, send it to me, I'll fix it.
If you still unable to fix it, send it to me, I'll fix it.
If you're absolutely certain
If you're absolutely certain that it really is being re-programmed then the oscillator is working fine and the MAX232 is working fine as well. That doesn't explain why it won't take maps though
I use Bray's Terminal to test MJLJ - it's like Hyperterminal but much much better! Download it from:
http://bray.velenje.cx/avr/terminal/
(..and the hint is that the download link is three lines up from the bottom!)
Unzip it to a folder (it's only one file - I leave it on my Desktop) and run it.
Configure the Terminal to use the port you want to, the correct baud rate (4800) stop bits etc at the top and press Connect.
Set the receive box to display Hex - that way you don't get unprintable characters being returned from MJLJ, like what you get in Hyperterminal
In the Transmit area, type a 'C' (no quotes) and press the ->Send button. This is the command to get the MJLJ to send its map to the PC - you should get 128 bytes of data back...and you should be able to see some similarities between the bytes returned and the map itself.
If you send a 'S' to the MJLJ, it returns the runtime display information, as a set of 6 bytes of information.
Report back on what happens....and we'll think some more!
By the way, I always run my MJLJ from a 9v battery on the bench - there's absolutely no reason that it needs a 12v supply...the voltage regulator in the MJLJ is quite happy providing 5v for the circuitry from a 9v supply (well, the regulator gets more like 8.4v, since there is a reverse-polarity protection diode that robs the full 9v by 0.6v, but the regulator is equally happy with that too). The current demands of the MJLJ are tiny. A 9v battery is perfectly adequate.
I use Bray's Terminal to test MJLJ - it's like Hyperterminal but much much better! Download it from:
http://bray.velenje.cx/avr/terminal/
(..and the hint is that the download link is three lines up from the bottom!)
Unzip it to a folder (it's only one file - I leave it on my Desktop) and run it.
Configure the Terminal to use the port you want to, the correct baud rate (4800) stop bits etc at the top and press Connect.
Set the receive box to display Hex - that way you don't get unprintable characters being returned from MJLJ, like what you get in Hyperterminal
In the Transmit area, type a 'C' (no quotes) and press the ->Send button. This is the command to get the MJLJ to send its map to the PC - you should get 128 bytes of data back...and you should be able to see some similarities between the bytes returned and the map itself.
If you send a 'S' to the MJLJ, it returns the runtime display information, as a set of 6 bytes of information.
Report back on what happens....and we'll think some more!
By the way, I always run my MJLJ from a 9v battery on the bench - there's absolutely no reason that it needs a 12v supply...the voltage regulator in the MJLJ is quite happy providing 5v for the circuitry from a 9v supply (well, the regulator gets more like 8.4v, since there is a reverse-polarity protection diode that robs the full 9v by 0.6v, but the regulator is equally happy with that too). The current demands of the MJLJ are tiny. A 9v battery is perfectly adequate.
the MAX232 isn't a
the MAX232 isn't a 'communication' chip- it's a level-shifter to make the 5V TTL voltages compatible with the RS232 spec and vice versa.
As martin pointed out, a 9V battery is plenty to power the megajolt, if uncertain, just ensure you can measure +5v on the other side of the voltage regulator.
Martin's troubleshooting steps are spot on, thanks for writing that up.
As martin pointed out, a 9V battery is plenty to power the megajolt, if uncertain, just ensure you can measure +5v on the other side of the voltage regulator.
Martin's troubleshooting steps are spot on, thanks for writing that up.
Results
Right, that terminal program didn't work either! Neither C or S gave anything back. I'm using a model boat battery which is 12v so no power issues. I should add that I've got my own MegaJolt (v2) which works fine and communicates with my laptop fine.
Below is the output when reprogramming with the bootloader:
C:\My Documents\megajolt\firmware>hc08sprg com1 mjlJunior_3.0.0.s19
Waiting for HC08 reset ACK...received 0xfc (good).
Calibration break pulse sent. Count: 1
Bootloader version string: KX8-IR
Available flash memory: 0xE000-0xFC7F
Erase block size: 64 bytes
Write block size: 32 bytes
Original vector table: 0xFFDC
Bootloader user table: 0xFC80
Bootloader data (hex): 82 80 00 00 00 78 20 f3
Are you sure to program part? [y/N]: y
Memory programmed: 100%
Which seems to work fine. However, nothing else does!
Any more suggestions?
Matt Dearden
http://www.cate1.co.uk/megajolt
Below is the output when reprogramming with the bootloader:
C:\My Documents\megajolt\firmware>hc08sprg com1 mjlJunior_3.0.0.s19
Waiting for HC08 reset ACK...received 0xfc (good).
Calibration break pulse sent. Count: 1
Bootloader version string: KX8-IR
Available flash memory: 0xE000-0xFC7F
Erase block size: 64 bytes
Write block size: 32 bytes
Original vector table: 0xFFDC
Bootloader user table: 0xFC80
Bootloader data (hex): 82 80 00 00 00 78 20 f3
Are you sure to program part? [y/N]: y
Memory programmed: 100%
Which seems to work fine. However, nothing else does!
Any more suggestions?
Matt Dearden
http://www.cate1.co.uk/megajolt
-
- Posts: 68
- Joined: Mon Sep 13, 2004 8:45 am
- Location: The Chalfonts
- Contact:
Oscillator problem
If you can program the chip, but it wont talk to you afterwards then you may well have a fault with the crystal oscillator. The microprocessor uses an internal oscillator for downloading and reprogramming, but Megajolt uses the crystal oscillator instead of the internal oscillator because it is more precise.
That's my thinking
Well I've got a spare oscillator, so I'll replace it and see if that helps. I've already done the voltage checks and there's 5v in all the right places, so no danger of blowing it up!
Matt Dearden
http://www.cate1.co.uk/megajolt
Matt Dearden
http://www.cate1.co.uk/megajolt
Now working!
Just in case anyone was wondering I've now got it working. I replaced the oscillator and all is well )
cheers
Matt Dearden
http://www.cate1.co.uk/megajolt
cheers
Matt Dearden
http://www.cate1.co.uk/megajolt
-
- Posts: 68
- Joined: Mon Sep 13, 2004 8:45 am
- Location: The Chalfonts
- Contact:
Well done
Well done