Hello Stephen,

Stephen Simmons <deeps...@gmail.com> writes:

> I have been trying to get the 644P  'sanguino' to build and run, but it
> never initializes uart0 properly. Leaves out the initialization of the
> UBRR.  The baud rate is defined in the INC.  I believe that I have gone
> through the instructions as best I can, but they don't exactly (to me)
> match the 6.9 layout.  I have been able to build from both the command line
> and MicroChip studio.  I have been working with AVR for well
> over 20 years.

concentrating on this part.

The controller never talks to you? Is that "the error"?

given:
- controller atmega644p
- board? sanguino??? I don't think, I have one of those ...

releases/6.9/appl/arduino/sanguino.asm says:
| .include "preamble.inc"
| .equ F_CPU = 16000000
| .include "drivers/usart_0.asm"
| .include "amforth.asm"

- crystal frequency? 16 MHz
- uart? usart_0.asm, which means pins d0,d1


Now. The Arduinos are sold with a bootloader on them and
specific fuse settings. As far as I can tell, you always need to
double check and mostly change the fuses.

on atmega644p I use LFUSE=0xd7 HFUSE=0x99
or (more often)     LFUSE=0xe6 HFUSE=0x99

releases/6.9/appl/arduino/readme.txt says:
Fuses (E,H,L) FD F9 FF (Sanguino)

So there is a difference. I have in the past prodded a few hours
reading the datasheet to understand this. And then I never touch
it again. There are websites to help with this, but I always use
the datasheet.

Then there is the baudrate hiding somewhere ...
releases/6.9/avr8/preamble.inc says:
; 10 per mille (1 per cent) is ok.
.set BAUD = 38400

ok. Now, what do I actually use? I have started with amforth
before the appl/arduino directory existed. So I always base my
projects on appl/template. And thus:

| .../firmware/station-0x7f 33 > grep -v '^;' main.asm | grep -v '^$'
| .include "preamble.inc"
| .set AMFORTH_RO_SEG = NRWW_START_ADDR
| .equ F_CPU = 11059200
| .set BAUD=115200
| .include "drivers/usart_0.asm"
| .set WANT_IGNORECASE = 0
| .set WANT_INTERRUPTS = 1
| .set WANT_INTERRUPT_COUNTERS = 1
| .include "amforth.asm"

Note that I use a baud rate crystal.

Does this help?

>>>snip<

Cheers,
Erich


-- 
May the Forth be with you ...


_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to